edu.stanford.nlp.trees
Class UnnamedConcreteDependency
java.lang.Object
edu.stanford.nlp.trees.UnnamedDependency
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
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)
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