How do I split a sentence into several phrases?

  python

I want to split a sentence into several meaningful part, for example:
I have an input from user:Samsung phone case , I want to split in to a list:[‘Samsung phone’, ‘phone case’,’Samsung phone case’], that means ‘Samsung phone’ is a valid object, ‘phone case’ is another valid object, ‘Samsung phone case’ also is a valid object, how to do this with python?

Source: Python Questions

LEAVE A COMMENT