datetime - Parsing a string for dates in PHP -


Looking at an arbitrary string, for example ( "I'm going to play Croquet next Friday" / Code>

If this is looking like a very good candidate, can you think about it?

Hard basket, maybe you can give an alternative suggestion. I want to be able to parse Twitter messages for dates. I will see the tweets They are directing in Eva, so they can be trained to use an easy form, although I would like to be as transparent as possible. Is there a good middle ground that you can think of? < / Div>

If you have HP, then you try the following algorithm I'm showing an example, And leaving the tedious work on you :)

  // words Trying to do stratetime () on each corresponding subgroup of ... // stratotime ("June 17 already") strtotime ("June already already" Strtotime ("already") "Gadzooks, it is already June 17" strtotime ("it is already June 17") / second strtotime strtotime ("Gadzuk, it is June 17") strtotime (" This is June 17 "strtotime (" June 17 ") // Date! Strtotime ("June") // date! // third repetition strtotime strtotime ("this 17th") strtotime ("it is 17th") strtotime ("it is 17th") strtotime ("17th") // date! // 4th walking strtotime ("Gadzooks, this is") // etc  

and we can assume that is more accurate than strtotime ("17th June") strtotime ("17th") Just because there are more words in it ... i.e. "next friday" will always be more accurate than "Friday".


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -