Recommend this page to a friend! |
All requests | > | Get all words in sentence | > | Request new recommendation | > | Featured requests | > | No recommendations |
by Mehran Ko - 8 years ago (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 |
6. by Mohammad Keramatifar - 8 years ago (2016-05-18) Reply
did you get the answer?
5. by Anthony Amolochitis - 8 years ago (2016-04-16) Reply
Have you thought about using explode? What are you trying to do with the words. Is it the ordering? I do something with a class that I wrote for personal use that reads words in and looks for variables in it and does replacements. Let us know what you are trying to do to clarify. Otherwise just use explode to bust the words apart by a space.
4. by Anthony Amolochitis - 8 years ago (2016-04-16) Reply
Have you thought about using explode? What are you trying to do with the words. Is it the ordering? I do something with a class that I wrote for personal use that reads words in and looks for variables in it and does replacements. Let us know what you are trying to do to clarify. Otherwise just use explode to bust the words apart by a space.
1. by Manuel Lemos - 8 years 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 - 8 years 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 years 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.
+1 | by Lionel F. Lebeau 140 - 8 years ago (2016-04-16) Comment You can use this class to get an array of words. This array can be filtered with an optional stopwords array; The result array can be a lower one or contain the original case. I used your examples to create the rules. So, you'll get A/C and 25,000, not A, C, 25, 000 in the resulting array. |
+1 | by Till Wehowski 115 - 8 years 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'] |
1. by Mehran Ko - 8 years ago (2016-04-16) Reply
thanks,, downloaded,its good one ,,,
2. by Till Wehowski Reply
- 8 years ago (2016-04-16) in reply to comment 1 by Mehran KoUnfortunatly phpclasses.org does not allow to recommend more than one package (@Manuel?!) The Link to "Automatic Keyord Genrator" is http://www.phpclasses.org/package/3245-PHP-Automatically-suggest-keywords-from-content-text.html
3. by Mehran Ko - 8 years ago (2016-04-17) in reply to comment 2 by Till Wehowski Reply
yes i have about 40 megabyte text file,,
thanks in advance
Recommend package | |
|