edu.stanford.nlp.trees
Interface Dependency<G extends Label,D extends Label,N>

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
NamedDependency, UnnamedDependency

public interface Dependency<G extends Label,D extends Label,N>
extends java.io.Serializable

An individual dependency between a governor and a dependent. The governor 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 or CoreLabel. Dependencies support an Object naming the dependency type. This may be null. Dependencies have factories.

Author:
Christopher Manning

Method Summary
 DependencyFactory dependencyFactory()
          Provide a factory for this kind of dependency
 D dependent()
          Describes the dependent (argument/modifier) of the dependency relation.
 boolean equalsIgnoreName(java.lang.Object o)
          Are two dependencies equal if you ignore the dependency name.
 G governor()
          Describes the governor (regent/head) of the dependency relation.
 N name()
          Names the type of dependency (subject, instrument, ...).
 java.lang.String toString(java.lang.String format)
          Provide different printing options via a String keyword.
 

Method Detail

governor

G governor()
Describes the governor (regent/head) of the dependency relation.

Returns:
The governor of this dependency

dependent

D dependent()
Describes the dependent (argument/modifier) of the dependency relation.

Returns:
the dependent of this dependency

name

N name()
Names the type of dependency (subject, instrument, ...). This might be a String in the simplest case, but can provide for arbitrary object types.

Returns:
the name for this dependency type

equalsIgnoreName

boolean equalsIgnoreName(java.lang.Object o)
Are two dependencies equal if you ignore the dependency name.

Parameters:
o - The thing to compare against ignoring name
Returns:
true iff the head and dependent are the same.

toString

java.lang.String toString(java.lang.String format)
Provide different printing options via a String keyword. The main recognized option currently is "xml". Otherwise the default toString() is used.

Parameters:
format - A format string, either "xml" or you get the default
Returns:
A String representation of the dependency

dependencyFactory

DependencyFactory dependencyFactory()
Provide a factory for this kind of dependency

Returns:
A DependencyFactory


Stanford NLP Group