|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.trees.TreeGraph
edu.stanford.nlp.trees.GrammaticalStructure
edu.stanford.nlp.trees.EnglishGrammaticalStructure
public class EnglishGrammaticalStructure
A GrammaticalStructure for English.
The parser should be run with the "-retainNPTmpSubcategories" option! Caveat emptor! This is a work in progress. Suggestions welcome.
Field Summary | |
---|---|
static String |
CONJ_MARKER
|
Fields inherited from class edu.stanford.nlp.trees.GrammaticalStructure |
---|
allTypedDependencies, dependencies, typedDependencies |
Fields inherited from class edu.stanford.nlp.trees.TreeGraph |
---|
root |
Constructor Summary | |
---|---|
EnglishGrammaticalStructure(Tree t)
Construct a new GrammaticalStructure from an
existing parse tree. |
|
EnglishGrammaticalStructure(Tree t,
Filter<String> puncFilter)
Construct a new GrammaticalStructure from an
existing parse tree. |
Method Summary | |
---|---|
protected void |
collapseDependencies(Collection<TypedDependency> list,
boolean CCprocess)
Destructively modifies this TypedDependencyList by
collapsing two types of transitive pairs of dependencies:
prepositional dependencies
dep(cat, in) and
dep(in, hat) are collapsed to
in(cat, hat)
conjunct dependencies
cc(investors, and) and
conj(investors, regulators) are collapsed to
|
protected GrammaticalRelation |
conjValue(Object conj)
|
protected void |
correctDependencies(Collection<TypedDependency> list)
Destructively modify the TypedDependencyGraph to correct
language-dependent dependencies. |
protected static SemanticHeadFinder |
getSemanticHeadFinder(Tree t)
Initialize shf according to the type of t we have (add flags?) If t represents an existential sentence, we don't want a copular treatment of it. |
TreeGraphNode |
getSubject(TreeGraphNode t)
Tries to return a node representing the SUBJECT (whether
nominal or clausal) of the given node t . |
static void |
main(String[] args)
Just for testing. |
Methods inherited from class edu.stanford.nlp.trees.GrammaticalStructure |
---|
allTypedDependencies, dependencies, getAllDependents, getDependencyPath, getDependencyPath, getDependents, getDeps, getGovernor, getGrammaticalRelation, getGrammaticalRelation, getListGrammaticalRelation, getNodeInRelation, toString, typedDependencies, typedDependencies, typedDependenciesCCprocessed, typedDependenciesCollapsed, typedDependenciesCollapsed |
Methods inherited from class edu.stanford.nlp.trees.TreeGraph |
---|
addNodeToIndexMap, getNodeByIndex, getNodes, root |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CONJ_MARKER
Constructor Detail |
---|
public EnglishGrammaticalStructure(Tree t)
GrammaticalStructure
from an
existing parse tree. The new GrammaticalStructure
has the same tree structure and label values as the given tree
(but no shared storage). As part of construction, the parse tree
is analyzed using definitions from GrammaticalRelation
to populate the new
GrammaticalStructure
with as many labeled
grammatical relations as it can.
public EnglishGrammaticalStructure(Tree t, Filter<String> puncFilter)
GrammaticalStructure
from an
existing parse tree. The new GrammaticalStructure
has the same tree structure and label values as the given tree
(but no shared storage). As part of construction, the parse tree
is analyzed using definitions from GrammaticalRelation
to populate the new
GrammaticalStructure
with as many labeled
grammatical relations as it can.
Method Detail |
---|
protected static SemanticHeadFinder getSemanticHeadFinder(Tree t)
t
- public TreeGraphNode getSubject(TreeGraphNode t)
SUBJECT
(whether
nominal or clausal) of the given node t
.
Probably, node t
should represent a clause or
verb phrase.
t
- a node in this GrammaticalStructure
t
, or else null
protected void correctDependencies(Collection<TypedDependency> list)
GrammaticalStructure
TypedDependencyGraph
to correct
language-dependent dependencies. (e.g., nsubjpass in a relative clause)
Default is no-op; to be over-ridden in subclasses.
correctDependencies
in class GrammaticalStructure
protected void collapseDependencies(Collection<TypedDependency> list, boolean CCprocess)
TypedDependencyList
by
collapsing two types of transitive pairs of dependencies:
dep(cat, in)
and
dep(in, hat)
are collapsed to
in(cat, hat)
cc(investors, and)
and
conj(investors, regulators) are collapsed to
and(investors,regulators)
possessive(Montezuma, 's)
will be erased
For relative clauses, it will collapse referent such as:
ref(man, that)
and
dobj(love, that)
are collapsed to
dobj(love, man)
collapseDependencies
in class GrammaticalStructure
protected GrammaticalRelation conjValue(Object conj)
public static void main(String[] args)
java edu.stanford.nlp.trees.EnglishGrammaticalStructure -[treeFile FILE | -sentFile FILE]
[-testGraph GRAPH]
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |