edu.stanford.nlp.trees
Class NamedDependency

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

public class NamedDependency
extends UnnamedDependency

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 NamedConstituent.

Author:
Christopher Manning, Spence Green
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.stanford.nlp.trees.UnnamedDependency
dependentText, regentText
 
Constructor Summary
NamedDependency(Label regent, Label dependent, Object name)
           
NamedDependency(String regent, String dependent, Object name)
           
 
Method Summary
 DependencyFactory dependencyFactory()
          Provide a factory for this kind of dependency
 boolean equals(Object o)
           
static DependencyFactory factory()
           
 int hashCode()
           
 Object name()
          Names the type of dependency (subject, instrument, ...).
 String toString()
           
 String toString(String format)
          Provide different printing options via a String keyword.
 
Methods inherited from class edu.stanford.nlp.trees.UnnamedDependency
dependent, equalsIgnoreName, getText, governor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedDependency

public NamedDependency(String regent,
                       String dependent,
                       Object name)

NamedDependency

public NamedDependency(Label regent,
                       Label dependent,
                       Object name)
Method Detail

name

public 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,Object>
Overrides:
name in class UnnamedDependency
Returns:
the name for this dependency type

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