Design specs

Original Page Layout

If generate is selected, the lexical entries and syntactic rules are used to generate a number of random sentences in the bottom left box. If parse is selected, the sentence/sentences in the bottom left box are parsed using the rules specified and the resulting svg is put in the box on the right. Depth limit is used to prevent recursion from causing problems in the parse generated.

There was also a timeout so that if it took too long to parse the sentence, it was just aborted.

Rule format

The rules input could be of two types, lexical rules and syntactic rules.

Lexical rules

These rules consist of a lexical category label, a colon and then a thing that is part of that category.

for example N : dog

in addition, a set can be specified

N : {dog, cat}

this means that both dog and cat are N's.

Syntactic rules

These rules consist of a syntactic category label, an arrow and then component constituents.

NP -> Det N

Scope of rules

Should be able to handle

  • Optionality using parenthesis
  • Repetition using *
  • Right hand sides should be able to be non-binary