Constituent tree

From OpenCog
Jump to: navigation, search

The Link Grammar parser can generate a Penn tree-bank style phrase structure. For example:

(S (NP The commie) (VP was (ADJP red)) .)

The phrase structure as output by RelEx is identical to that output by the link grammar parser; RelEx does not modify it. RelEx does use the phrase structure in various ways, including the Hobbs algorithm anaphora resolution algorithm.

There are a number of different possible phrase types:

Description Penn type Example
adjective phrase ADJP
adverb phrase ADVP
sentence clause S (S (NP (NP The commie) , (SBAR (WHNP who) (S (VP was (ADJP red)))) ,) (VP faded (PRT away)) .)
inverted subject-verb clause SINV
noun phrase NP
particle PRT (S (NP (NP The commie) , (SBAR (WHNP who) (S (VP was (ADJP red)))) ,) (VP faded (PRT away)) .)
prepositional phrase PP (S (NP There) (VP were (NP (NP three) (PP of (NP them)))) .)
quantifier phrase QP
root clause S
subordinate clause SBAR (S (NP (NP The commie) , (SBAR (WHNP who) (S (VP was (ADJP red)))) ,) (VP faded (PRT away)) .)
verb phrase VP
wh-adverb WHADVP (S (NP The bridge) (VP was (ADJP unfinished)) (SBAR (WHADVP when) (S (NP it) (VP collapsed))) .)
wh-noun WHNP (S (NP (NP The commie) , (SBAR (WHNP who) (S (VP was (ADJP red)))) ,) (VP faded (PRT away)) .)
wh-prep WHPP (S (NP The commie (SBAR (WHPP to (WHNP whom)) (S (NP I) (VP was))) speaking) (VP was (ADJP red)) .)