Package edu.stanford.nlp.trees
Class UnnamedDependency
- java.lang.Object
-
- edu.stanford.nlp.trees.UnnamedDependency
-
- All Implemented Interfaces:
Dependency<Label,Label,Object>,Serializable
- Direct Known Subclasses:
NamedDependency,UnnamedConcreteDependency
public class UnnamedDependency extends Object implements Dependency<Label,Label,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, Spence Green
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringdependentTextprotected StringregentText
-
Constructor Summary
Constructors Constructor Description UnnamedDependency(Label regent, Label dependent)UnnamedDependency(String regent, String dependent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DependencyFactorydependencyFactory()Provide a factory for this kind of dependencyLabeldependent()Describes the dependent (argument/modifier) of the dependency relation.booleanequals(Object o)booleanequalsIgnoreName(Object o)Are two dependencies equal if you ignore the dependency name.static DependencyFactoryfactory()protected StringgetText(Label label)Labelgovernor()Describes the governor (regent/head) of the dependency relation.inthashCode()Objectname()Names the type of dependency (subject, instrument, ...).StringtoString()StringtoString(String format)Provide different printing options via a String keyword.
-
-
-
Method Detail
-
governor
public Label governor()
Description copied from interface:DependencyDescribes the governor (regent/head) of the dependency relation.- Specified by:
governorin interfaceDependency<Label,Label,Object>- Returns:
- The governor of this dependency
-
dependent
public Label dependent()
Description copied from interface:DependencyDescribes the dependent (argument/modifier) of the dependency relation.- Specified by:
dependentin interfaceDependency<Label,Label,Object>- Returns:
- the dependent of this dependency
-
name
public Object name()
Description copied from interface:DependencyNames the type of dependency (subject, instrument, ...). This might be a String in the simplest case, but can provide for arbitrary object types.- Specified by:
namein interfaceDependency<Label,Label,Object>- Returns:
- the name for this dependency type
-
equalsIgnoreName
public boolean equalsIgnoreName(Object o)
Description copied from interface:DependencyAre two dependencies equal if you ignore the dependency name.- Specified by:
equalsIgnoreNamein interfaceDependency<Label,Label,Object>- Parameters:
o- The thing to compare against ignoring name- Returns:
- true iff the head and dependent are the same.
-
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:
toStringin interfaceDependency<Label,Label,Object>- 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:DependencyProvide a factory for this kind of dependency- Specified by:
dependencyFactoryin interfaceDependency<Label,Label,Object>- Returns:
- A DependencyFactory
-
factory
public static DependencyFactory factory()
-
-