Phrase structure rule grammar engine in JavaScript