Ask HN: Best way to implement natural language commands for todo's, reminder etc
https://news.ycombinator.com/item?id=382918I am working on an application that I want to allow users to enter commands in natural language, eg:
Followup in two days
Followup on November 23rd at 3pm
Remind me about my dentist appointment at 3.30pm on December 12th 2008
Clearly there can be lots of subtle variations on what exactly gets entered in these sort of scenarios which makes for a potentially tricky/interesting problem.
Listening to a podcast recently, Joel Spolsky mentioned that people with no knowledge of compilers would tend to tackle a parsing problem like this the 'hard way' (ie using regexes, searching strings etc) while they may be better using a lexer/compiler approach. I have no knowledge of compilers, so my thinking right now is to scan for keywords and then things that look like dates using regexes.
Has anyone implemented anything that does this sort of this command processing and have any tips or tools to share? My application is in Rails, but I am willing to experiment - I just don't want to have many hundreds of lines of code testing for all sorts of strange conditions making for a brittle maintenance nightmare!