I'm interested in writing a parsing engine such as the ones in Inform, which is very robust.
I've tried a couple of different approach:
{verb} {noun1 optional-noun2} {optional-preposition} {indirect-noun1 optional-indirect-noun2} This doesn't work that well.I know about language processing though I have actually no idea how to start and some of the stuff are too complicated. (No CS background, I'm just learning on my own right now).
Some ideas I have:
Is there any other ideas? How would I go about design and implementing them?
Note I'm using Python as my language. and in case you missed it, I'm not design a programming language, I'm just parsing user command such as "go north" or complex stuff, like "put the fire out with the blanket"
Besides the mentioned pyparsing, which looks very appropriate (I've only used it a tiny bit), you should look into using nltk. It's a great collection of tools for natural language processing, and there's even a book.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With