PHP Classes
elePHPant
Icontem

Get all words in sentence: Some class to get all of words in sentence

Recommend this page to a friend!
  All requests RSS feed  >  Get all words in sentence  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Get all words in sentence

A request is featured when there is no good recommended package on the site when it is posted. Edit

Picture of Mehran Ko by Mehran Ko - Yesterday (2016-04-15)

Some class to get all of words in sentence

This request is clear and relevant.
This request is not clear or is not relevant.

+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 Clarification request
  • 1. Picture of Manuel Lemos 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. Picture of Mehran Ko 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. Picture of Manuel Lemos 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.

Ask clarification

1 Recommendation

wText: Detect and filter spam in text

This recommendation solves the problem.
This recommendation does not solve the problem.

0

Picture of Till Wehowski by Till Wehowski package author package author Reputation 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
: 
: