edu.stanford.nlp.trees
Class UnnamedDependency

java.lang.Object
  extended by edu.stanford.nlp.trees.UnnamedDependency
All Implemented Interfaces:
Dependency, java.io.Serializable, java.lang.Comparable

public class UnnamedDependency
extends java.lang.Object
implements Dependency, java.io.Serializable, java.lang.Comparable

An individual dependency between a head and a dependent. The head and dependent are represented as a Label. For example, these can be a Word or a WordTag. If one wishes the dependencies to preserve positions in a sentence, then each can be a LabeledConstituent.

See Also:
Serialized Form

Constructor Summary
UnnamedDependency(Label regent, Label dependent)
           
UnnamedDependency(java.lang.String regent, int regentStartIndex, int regentEndIndex, java.lang.String dependent, int depStartIndex, int depEndIndex)
           
UnnamedDependency(java.lang.String regent, int regentIndex, java.lang.String dependent, int dependentIndex)
           
UnnamedDependency(java.lang.String regent, java.lang.String dependent)
           
 
Method Summary
 int compareTo(java.lang.Object obj)
          Implementation of comparison for UnnamedDependency.
 DependencyFactory dependencyFactory()
          Provide a factory for this kind of dependency
 Label dependent()
          Describes the dependent (argument/modifier) of the dependency relation.
 boolean equalIgnoringName(java.lang.Object o)
          Are two dependencies equal if you ignore the dependency name.
 boolean equals(java.lang.Object o)
           
static DependencyFactory factory()
           
 Label governor()
          Describes the governor (regent/head) of the dependency relation.
 int hashCode()
           
 java.lang.Object name()
          Names the type of dependency (subject, instrument, ...).
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String format)
          Provide different printing options via a String keyword.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnnamedDependency

public UnnamedDependency(java.lang.String regent,
                         java.lang.String dependent)

UnnamedDependency

public UnnamedDependency(java.lang.String regent,
                         int regentIndex,
                         java.lang.String dependent,
                         int dependentIndex)

UnnamedDependency

public UnnamedDependency(java.lang.String regent,
                         int regentStartIndex,
                         int regentEndIndex,
                         java.lang.String dependent,
                         int depStartIndex,
                         int depEndIndex)

UnnamedDependency

public UnnamedDependency(Label regent,
                         Label dependent)
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

equalIgnoringName

public boolean equalIgnoringName(java.lang.Object o)
Description copied from interface: Dependency
Are two dependencies equal if you ignore the dependency name.

Specified by:
equalIgnoringName in interface Dependency

compareTo

public int compareTo(java.lang.Object obj)
Implementation of comparison for UnnamedDependency. Orders by governor, then dependent, then name.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - object to compare to
Returns:
result (positive if this is greater than obj)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.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

governor

public Label governor()
Description copied from interface: Dependency
Describes the governor (regent/head) of the dependency relation.

Specified by:
governor in interface Dependency

dependent

public Label dependent()
Description copied from interface: Dependency
Describes the dependent (argument/modifier) of the dependency relation.

Specified by:
dependent in interface Dependency

name

public java.lang.Object name()
Description copied from interface: Dependency
Names the type of dependency (subject, instrument, ...). This might be a String in the simplest case, but can provide for arbitrary object types.

Specified by:
name in interface Dependency

dependencyFactory

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

Specified by:
dependencyFactory in interface Dependency

factory

public static DependencyFactory factory()