Message Boards Message Boards

2 Replies
1 Total Likes
View groups...
Share this post:

GrammarRules and GrammarApply


Why is it that GrammarRules[] and GrammarApply[] functions work only on the cloud? What if I want to experiment with parsing languages, but want them to run my local Mathematica? I am running ver 10.1, so I guess I am not missing something.



2 Replies

That is interesting information. Thanks.



For simple grammars without GrammarTokens, you can make a recursive decent parser. Mathematica's pattern matching helps a lot, often making writing the simple parser trivial when compared to languages without it.

GrammarRules and GrammarApply use GrammarTokens. GrammarTokens are like Interpreters built into the grammar and have to be specially handled. Most GrammarTokens connect to Wolfram|Alpha, just like most Interpreters do.

Because these GrammarTokens query a server, parsing a string is more difficult. You want to minimize how many times you query the server and you want the queries to happen fast. Parsing on a server configured for this purpose seems like the ideal solution. I'm not aware of another piece of software or library in a similar situation.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract