Algorithm for analyzing text of words
- by Click Upvote
I want an algorithm which would create all possible phrases in a block of text. For example, in the text:
"My username is click upvote. I have 4k rep on stackoverflow"
It would create the following combinations:
"My username"
"My Username is"
"username is click"
"is click"
"is click upvote"
"click upvote"
"i have"
"i have 4k"
"have 4k"
..
You get the idea. Basically the point is to get all possible combinations of 'phrases' out of a sentence. Any thoughts for how to best implement this?