edu.stanford.nlp.trees
Class UnnamedConcreteDependency

java.lang.Object
  extended by edu.stanford.nlp.trees.UnnamedDependency
      extended by edu.stanford.nlp.trees.UnnamedConcreteDependency
All Implemented Interfaces:
Dependency<Label,Label,Object>, Serializable

public class UnnamedConcreteDependency
extends UnnamedDependency

An individual dependency between a head and a dependent. The dependency is associated with the token indices of the lexical items.

A key difference between this class and UnnamedDependency is the equals() method. Equality of two UnnamedConcreteDependency objects is defined solely with respect to the indices. The surface forms are not considered. This permits a use case in which dependencies in two different parse trees have slightly different pre-processing, possibly due to pre-processing.

Author:
Spence Green
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.stanford.nlp.trees.UnnamedDependency
dependentText, regentText
 
Constructor Summary
UnnamedConcreteDependency(Label regent, int regentIndex, Label dependent, int dependentIndex)
           
UnnamedConcreteDependency(Label regent, Label dependent)
           
UnnamedConcreteDependency(String regent, int regentIndex, String dependent, int dependentIndex)
           
 
Method Summary
 DependencyFactory dependencyFactory()
          Provide a factory for this kind of dependency
 boolean equals(Object o)
           
static DependencyFactory factory()
           
 int getDependentIndex()
           
 int getGovernorIndex()
           
 int hashCode()
           
 String toString()
           
 String toString(String format)
          Provide different printing options via a String keyword.
 
Methods inherited from class edu.stanford.nlp.trees.UnnamedDependency
dependent, equalsIgnoreName, getText, governor, name
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnnamedConcreteDependency

public UnnamedConcreteDependency(String regent,
                                 int regentIndex,
                                 String dependent,
                                 int dependentIndex)

UnnamedConcreteDependency

public UnnamedConcreteDependency(Label regent,
                                 int regentIndex,
                                 Label dependent,
                                 int dependentIndex)

UnnamedConcreteDependency

public UnnamedConcreteDependency(Label regent,
                                 Label dependent)
Method Detail

getGovernorIndex

public int getGovernorIndex()

getDependentIndex

public int getDependentIndex()

hashCode

public int hashCode()
Overrides:
hashCode in class UnnamedDependency

equals

public boolean equals(Object o)
Overrides:
equals in class UnnamedDependency

toString

public String toString()
Overrides:
toString in class UnnamedDependency

toString

public String toString(String format)
Provide different printing options via a String keyword. The recognized options are currently "xml", and "predicate". Otherwise the default toString() is used.

Specified by:
toString in interface Dependency<Label,Label,Object>
Overrides:
toString in class UnnamedDependency
Parameters:
format - A format string, either "xml" or you get the default
Returns:
A String representation of the dependency

dependencyFactory

public DependencyFactory dependencyFactory()
Description copied from interface: Dependency
Provide a factory for this kind of dependency

Specified by:
dependencyFactory in interface Dependency<Label,Label,Object>
Overrides:
dependencyFactory in class UnnamedDependency
Returns:
A DependencyFactory

factory

public static DependencyFactory factory()


Stanford NLP Group