by AvengerPenguin · 17y ago · 0 comments
You might notice things like a time is always after "at", a date "on" and a relative date "in". Ideas for rules:
Event -> Title When
Title -> <anything>
When -> TimeSpecifier When
TimeSpecifier -> "at" Time
TimeSpecifier -> "in" RelativeTime
TimeSpecifier -> "on" Date
...
Then you use semantics stuff to get the parser to return some expression that you can use, say a Python call: event(title=<title>, at=<time>, on=<date>).Just some things to think about and if you don't know grammars, then read up until you understand the example I gave at least. I just wrote it off the top of my head too, so I'm sure someone might find a mistake with it :-)
p.s. If you're as weird as me, you might even consider Prolog for parsing ;-)
No comments yet.