I would use the chunker to obtain verb and noun phrases from the input. You can then look for specific verbs and nouns you're interested in.
jds On Sun, Jan 8, 2012 at 4:05 PM, Sina Bahram <sbah...@nc.rr.com> wrote: > Hi all, > > I just joined the list after reading through the OpenNlp manual and playing > with some code. > > I think the tools provided by OpenNlp are fantastic; however my question is > this. are there other collections of code, recipes, > papers, or any additional resources at all instructing one how to use these > tools to achieve a specific purpose? > > For example, write now, I'd like to write a simple command parser. > > Maybe things like this: > > Make that bigger > Zoom in > Slice that 9 ways vertically > Give me 10 horizontal slices > Take me to Washington DC > Put North Carolina here > > How can I use the OpenNlp tools to do this? I understand that name finders > can be used to find things like "North Carolina", > although I could also simply use a POS tagger, I'm guessing, and simply see > what got marked as prp ... but how can I put together a > command parser, then start improving upon it through iteration, inclusion of > other heuristics and algorithms, etc. etc. > > Can I use the parser to shortcut through some of this? for example, can I ask > the parser what the direct object of the verb of a > sentence is, and expect it to reliably, within reason of course, give me the > major verb (the action) and major direct object (the > subject, perhaps) of a given sentence? > > For example: > > Input: > Put North Carolina here > > > And then I can call my methods like this? > getMainAction() --> returns "put" > getMainSubject() --> returns "north Carolina" > > or whatever ... I understand it's maybe not that simple, but I'm simply > wanting to know how and where to start, if that makes sense? > > Lastly, and definitely most importantly, thanks go to every single author and > contributor of OpenNlp. I'm quite impressed just by > playing with examples. > > Thanks in advance for any help. > > take care, > Sina > > > > > > Website: www.SinaBahram.com > Twitter: @SinaBahram > > >