Syntax Tree & Generative Grammer

SNPDETTheNOUNmanVPVPVERBsawNPDETtheNOUNburglarPPPwithNPDETtheNOUNbinoculars

1. Tree

SNPDETTheNOUNmanVPVERBsawNPNPDETtheNOUNburglarPPPwithNPDETtheNOUNbinoculars

2. Tree

#----------------------------------#
# Default Generative Grammar Rules #
#----------------------------------#

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

#---------------------------------#
# POS of sentence tagged by spaCy #
#---------------------------------#

DET -> 'The'
NOUN -> 'man'
VERB -> 'saw'
DET -> 'the'
NOUN -> 'burglar'
P -> 'with'
DET -> 'the'
NOUN -> 'binoculars'

Syntax Tree Bracket Notation

(S
  (NP (DET The) (NOUN man))
  (VP
    (VP (VERB saw) (NP (DET the) (NOUN burglar)))
    (PP (P with) (NP (DET the) (NOUN binoculars)))))

1. Tree

(S
  (NP (DET The) (NOUN man))
  (VP
    (VERB saw)
    (NP
      (NP (DET the) (NOUN burglar))
      (PP (P with) (NP (DET the) (NOUN binoculars))))))

2. Tree