I'm writing a command parser using Apache's OpenNLP. The problem is that OpenNLP sees some commands as noun phrases. For example, if I parse something like "open door", OpenNLP gives me (NP (JJ open) (NN door))
. In other words, it sees the phrase as "an open door" instead of "open the door". I want it to parse as (VP (VB open) (NP (NN door)))
. If I parse "open the door" it produces a VP, But I can't count on a person using determiners.
I'm currently trying to figure out how to perform surgery on the incorrect parse tree but the API documentation is severely lacking.