Syntax Generator


Lexical items

Phrase structure rules


(reset)


Instructions

This webpage will automatically generate up to 10 random phrases from a grammar fragment. (Click here for a demo)

1. Input lexical items, one per line, first the part of speech followed by the word itself, separated by a space.
Example: N book

2. Input phrase structure rules, first the label for the whole phrase, then exactly one or two daughter nodes, separated by spaces.
Example: NP A N
(Hint: the maximum number of daughter nodes is two. If you need three parts, you need to combine two rules.)

(Advanced: affixes can be marked with a hyphen on either side, as in pre- or -fix. This will make the grammar more complicated to write.)

Typos are not tolerated (for example, extra spaces or blank lines). The generator can't guess what you want it to do!

Please note: this website cannot save any data. If needed, save your work in a text document on your computer!

When you are ready, click Generate to see the results. You may click on any generated phrase to view a syntax tree.