Recommend this page to a friend! |
All requests | > | Get all words in sentence | > | Request new recommendation | > | Featured requests | > | No recommendations |
by Mehran Ko - Yesterday (2016-04-15)
+1 | I want to get all of words from this sentence. After having owned the BMW X3, the MDX is a pleasure to drive. Reliability is great for 25,000 miles. Only things wrong are Bluetooth; rings and cannot hear whose on the other end and many viable addresses do not show up on Navigation system. Dealer service excellent. A few miss-steps in design; no lights for A/C controls at night; rear view pic doesn't come on in reverse for 10 seconds, some wind noise, transmission can be rough and erratic. No ipod plug which I didn't realize until after I purchased. Front end design could be improved, very masculine. Sounds like a lot but I do really like this car. Also test drove BMW X5 and Lexus 400. Is there any library or prepared class to get all of words from this sentence cleanly? I know some functions exist like preg_match. EX: look at this sentence"now in 2016. i am mikel and i from USA" when i get words i should get ("now","in","2016","i","am","mikel","and","from","USA"); like this example |
1. by Manuel Lemos - 16 hours ago (2016-04-15) Reply
Yes, but what does this have to do with XML parser you used as keywords for this request?
2. by Mehran Ko - 16 hours ago (2016-04-15) in reply to comment 1 by Manuel Lemos Comment
i solved my problem with below code: preg_match_all('/\w+/', $str, $matches); // match words $matchesUnique = array_unique($matches[0]); // get new array w/o duplicates print_r($matchesUnique); echo "<br>";
so i needed function to find words and put them in array then delete stopwords from this array,
3. by Manuel Lemos - 8 hours ago (2016-04-16) in reply to comment 2 by Mehran Ko Comment
I did not find a class that does exactly that but I found classes that do more complicated things, like keeping words that are more frequent.
Maybe somebody can come up with a class that does more like what you need.
0 | by Till Wehowski 55 - 1 hour ago (2016-04-16) Comment You can use this class to remove stopwords from a text. It does a bit more, maybe you have to do little modifications. The cleaned text you can find in $this->buf['clean'] / $this->buf['clean_spammy'] |
Recommend package | |
|