Alex Rivera | Logout

Natural Language Processing in PHP

Asked 2011-10-18T23:05:26.953
11

Given, say, a recipe (list of ingredients, steps, etc.) in free text form, how could I parse that in such a way I can pull out the ingredients (e.g. quantity, unit of measurements, ingredient name, etc.) usin PHP?

Assume that the free text is somewhat formatted.

Edit
Report

1 Answer

7

To do it 'properly', you need to define some sort of grammar, and then maybe use a LALR parser or some tools such as yacc, bison or Lex to build a parser. Assuming you dont want to do that, its strpos() ftw!

answered 2011-10-18T23:45:03.440

Your Answer