edu.stanford.nlp.trees
Interface Dependency

All Superinterfaces:
Serializable
All Known Implementing Classes:
UnnamedDependency

public interface Dependency
extends 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 MapLabel. 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
 Label dependent()
          Describes the dependent (argument/modifier) of the dependency relation.
 boolean equalsIgnoreName(Object o)
          Are two dependencies equal if you ignore the dependency name.
 Label governor()
          Describes the governor (regent/head) of the dependency relation.
 Object name()
          Names the type of dependency (subject, instrument, ...).
 String toString(String format)
          Provide different printing options via a String keyword.
 

Method Detail

governor

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

Returns:
The governor of this dependency

dependent

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

Returns:
the dependent of this dependency

name

Object 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(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

String toString(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