split string into words

by 4 replies
5
Hi,

I have following string:

"ilikewarriorforum"

How do i detect english words and split them into array that would contain the following:

Array
(
[0] => i
[1] => like
[2] => warrior
[3]=> forum
)

Can someone point me to the right direction.
I code in PHP
Any help would be appreciated.
#programming #split #string #words
  • There was a discussion about this once before and it seemed a lot of people were interested in it. I wish I could find it. I do remember that nobody here came up with an effective way of doing what you're asking.

    One of the problems is that a text string may have more than one combination of words. I suppose things would be made easier if the words to find in the string came from a very limited dictionary.

    Anyhow, I hope somebody else chimes in..
    • [1] reply
  • Which is also using a dictionary.
    No mater how you look at tackling this in any coding language it is going to require a dictionary of words to match against. And even then you would probably need an algorithm for checking against another list of common multiples that would be used together in a string.

Next Topics on Trending Feed