In Java there is a function called DictionaryBasedBreakIterator. The main purpose of this function is to break the word based on a dictionary file.
http://icu-project.org/apiref/icu4j/com ... rator.html
For example, when being used, it can break the word "DictionaryBasedBreakIterator" into "dictionary" "based" "break" "iterator".
Is there a similar function in PHP
Thanks
Is there a similar function - DictionaryBasedBreakIterator
Moderator: General Moderators
Re: Is there a similar function - DictionaryBasedBreakIterator
No. It should be fairly easy to write your own version by the sounds of it though.
Re: Is there a similar function - DictionaryBasedBreakIterator
You may check for the uppercase words and explode or break the string using that.
Re: Is there a similar function - DictionaryBasedBreakIterator
If you read the link the original poster posted you'll see it's used for things like breaking down sentences written in Thai (where they don't use spaces). I doubt it'll always be in nice camel caps. That approach won't work.starram wrote:You may check for the uppercase words and explode or break the string using that.
Re: Is there a similar function - DictionaryBasedBreakIterator
ok, I just read your Post.
Re: Is there a similar function - DictionaryBasedBreakIterator
onion2k, you are right! I'm going to use this function to break the Thai words. (and there is no cap-lock between words)
what I really want to know is how to make "thisisateststring" into "this is a test string"
what I really want to know is how to make "thisisateststring" into "this is a test string"