edu.stanford.nlp.trees
Class UnnamedDependency

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

public class UnnamedDependency
extends java.lang.Object
implements Dependency<Label,Label,java.lang.Object>

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.

Author:
Christopher Manning
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
 DependencyFactory dependencyFactory()
          Provide a factory for this kind of dependency
 Label dependent()
          Describes the dependent (argument/modifier) of the dependency relation.
 boolean equals(java.lang.Object o)
           
 boolean equalsIgnoreName(java.lang.Object o)
          Are two dependencies equal if you ignore the dependency name.
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

equalsIgnoreName

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

Specified by:
equalsIgnoreName in interface Dependency<Label,Label,java.lang.Object>
Parameters:
o - The thing to compare against ignoring name
Returns:
true iff the head and dependent are the same.

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<Label,Label,java.lang.Object>
Parameters:
format - A format string, either "xml" or you get the default
Returns:
A String representation of the 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<Label,Label,java.lang.Object>
Returns:
The governor of this 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<Label,Label,java.lang.Object>
Returns:
the dependent of this 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<Label,Label,java.lang.Object>
Returns:
the name for this dependency type

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,java.lang.Object>
Returns:
A DependencyFactory

factory

public static DependencyFactory factory()


Stanford NLP Group