Do not understand NLTK Regex Parsing Format

Viewed 929

I dont understand how does NLTK Regex Parsing Syntax works. Kindly see below.

parser = RegexpParser('''
    NP: {<DT>? <JJ>* <NN>*} # NP
    P: {<IN>}           # Preposition
    V: {<V.*>}          # Verb
    PP: {<P> <NP>}      # PP -> P NP
    VP: {<V> <NP|PP>*}  # VP -> V (NP|PP)*
    ''')

What does <DT>? or * mean. Whats the difference between <V>.* and <V.*>

Thanks

1 Answers
Related