edu.stanford.nlp.trees
Class NamedDependency
java.lang.Object
edu.stanford.nlp.trees.UnnamedDependency
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
NamedDependency
public NamedDependency(String regent,
String dependent,
Object name)
NamedDependency
public NamedDependency(Label regent,
Label dependent,
Object name)
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