edu.stanford.nlp.trees
Class EnglishGrammaticalStructure

java.lang.Object
  extended by edu.stanford.nlp.trees.TreeGraph
      extended by edu.stanford.nlp.trees.GrammaticalStructure
          extended by edu.stanford.nlp.trees.EnglishGrammaticalStructure
All Implemented Interfaces:
Serializable

public class EnglishGrammaticalStructure
extends GrammaticalStructure

A GrammaticalStructure for English. Caveat emptor! This is a work in progress. Nothing in here should be relied upon to function perfectly. Feedback welcome.

Author:
Bill MacCartney
See Also:
Serialized Form

Field Summary
protected  TypedDependencyList moreTypedDependencies
           
 
Fields inherited from class edu.stanford.nlp.trees.GrammaticalStructure
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.
 
Method Summary
protected  void collapseDependencies(TypedDependencyList list)
          Destructively modifies this TypedDepedencyList by collapsing two types of transitive pairs of dependencies: prepositional dependencies dep(cat, in) and dep(in, hat) are collapsed to in(cat, hat) possessive dependencies dep(revenge, 's) and dep('s, Montezuma) are collapsed to poss(revenge, Montezuma)
 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.
protected  TypedDependencyList moreTypedDependencies()
          Get "extra" dependencies.
 
Methods inherited from class edu.stanford.nlp.trees.GrammaticalStructure
dependencies, getDependencyPath, getDependencyPath, getDependents, getGovernor, getGrammaticalRelation, getGrammaticalRelation, getNodeInRelation, toString, typedDependencies, typedDependencies, typedDependenciesCollapsed, typedDependenciesCollapsed
 
Methods inherited from class edu.stanford.nlp.trees.TreeGraph
addNodeToIndexMap, getNodeByIndex, root
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

moreTypedDependencies

protected TypedDependencyList moreTypedDependencies
Constructor Detail

EnglishGrammaticalStructure

public EnglishGrammaticalStructure(Tree t)
Construct a new 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

moreTypedDependencies

protected TypedDependencyList moreTypedDependencies()
Get "extra" dependencies. Currently, the only "extra" implemented is the controlling subject relation. For example, in the sentence "Tom likes to eat fish", requesting extras will cause "xsubj(eat, Tom)" to be added to the typed dependency list.

Overrides:
moreTypedDependencies in class GrammaticalStructure

getSubject

public TreeGraphNode getSubject(TreeGraphNode t)
Tries to return a node representing the SUBJECT (whether nominal or clausal) of the given node t. Probably, node t should represent a clause or verb phrase.

Parameters:
t - a node in this GrammaticalStructure
Returns:
a node which is the subject of node t, or else null

collapseDependencies

protected void collapseDependencies(TypedDependencyList list)
Destructively modifies this TypedDepedencyList by collapsing two types of transitive pairs of dependencies:
prepositional dependencies
dep(cat, in) and dep(in, hat) are collapsed to in(cat, hat)
possessive dependencies
dep(revenge, 's) and dep('s, Montezuma) are collapsed to poss(revenge, Montezuma)

Overrides:
collapseDependencies in class GrammaticalStructure

main

public static void main(String[] args)
Just for testing. Usage: java GrammaticalStructure [treeFile]



Stanford NLP Group