Syntax Tree Generator

Enter your sentence

Choose usage of Generative Grammar

use Default Generative Grammar and spaCy-POS-Tagger

extend Default Generative Grammar and use spaCy-POS-Tagger

define and use your own Generative Grammar

Choose language of spaCy-POS-Tagger

English | spaCy-POS-Tagger

German | spaCy-POS-Tagger

Enter your Generative Grammar Rules

If you want to use the POS-Tagger by spaCy, make sure to use POS-Tags according to the convention of spaCy

click to here or press enter

Demo Sentences

Manual - How to use the Parser

Use Default Generative Grammar

You can enter sentences that can be generated by the given default generative grammar. Please note that these rules represent only a small subset of syntax rules for English sentences.

Extend Rules of the Default Generative Grammar

For the POS analysis (parts of speech), the POS-Tagger by spaCy. This means the preterminals of the generative grammar are defined by the spaCy POS-Tagger. Please ensure you use the correct tagger language:

  • English | spaCy-POS-Tagger ("en_core_web_lg")
  • German | spaCy-POS-Tagger ("de_core_news_lg")

Furthermore, please make sure to use the POS tags defined by spaCy when adding new rules to the default grammar. You can find the POS glossary for POS here. This functionality works only for English sentences. For sentences in German, please use the German POS-Tagger by spaCy. Furthermore, you can add non-terminals, terminals, blank lines and comments starting with #.

Use own Generative Grammar

If you wish to create your own generative grammar, you can freely select terminals, preterminals, and non-terminals (lexemes). Additionally, you have the flexibility to tag lexemes with preterminals of your choice. This enables you to represent your custom n-ary syntax tree and define the corresponding generative grammar rules. As an example for a generative grammar, you can add non-terminals, terminals, blank lines and comments starting with #.

#Nonterminals
S -> NP VP
NP -> N
VP -> VP NP
VP -> V
NP -> D N

#Terminals
D -> 'a'
N -> 'fish'
N -> 'He'
V -> 'eats'
            

Default Generative Grammar

S -> NP VP
S -> NP RC
S -> 'If' S 'then' S

VP -> VERB
VP -> VERB NP
VP -> VERB ADJ
VP -> VP PP
VP -> AUX VP
VP -> AUX 'not' VP
VP -> VP CCONJ VP

NP -> NOUN
NP -> DET NOUN
NP -> DET PROPN
NP -> PROPN
NP -> PRON
NP -> NP PP
NP -> NP RC
NP -> NP CCONJ NP

PP -> P NP

RC -> RPRON S