> Howdy all. Wondering if anyone's heard of a grammar parser behavior, > object or script in Lingo.
Hi Warren, I've written a few in lingo - context free, top-down, bottom-up, augmented grammers, link-node style (the one I am using in a project about to be released uses a combination of the last two). There is quite a bit of info on the net - and example code (mostly written in Lisp, which isn't too alien to Lingo). Commonly, they all use recursion to work your way through a sentence, making assumptions about what a word is based on what was previous, then checking that assumption by examing words further to the right (which are analysed the same way). When an assumption is proved wrong, you back up the parse tree and try another approach. The context free parsers are relatively straightforward (I might be able to dig up some old scripts -- I can't show you the ones I am using, unfortunately). The link-style parsers (which treat words a bit like pieces in a puzzle that can only join up with other pieces with matching connections) tend to involve much bigger search trees. Figuring out ways to 'prune' the search becomes more important. Anyway, the basic approaches - (event the context-free parsers) can be pretty good. You get to a point pretty quickly where the amount of code you write and processor cycles you use start to increase exponentially for tiny improvements in the parsing. Luke [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
