Record Class DependencyArc
java.lang.Object
java.lang.Record
opennlp.tools.depparse.DependencyArc
- Record Components:
head- The zero-based index of the governing token, orROOT_HEADwhen the dependent is the sentence root.dependent- The zero-based index of the governed token.relation- The dependency relation label, for examplensubj.
One labeled edge of a
DependencyTree: the token at dependent is governed
by the token at head under the given relation.
Indices are zero-based positions in the token array the tree was built over. A
head of ROOT_HEAD marks the dependent as the sentence root, which is
attached to the artificial root node rather than to another token.
- Since:
- 3.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intTheheadvalue marking an arc from the artificial root node. -
Constructor Summary
ConstructorsConstructorDescriptionDependencyArc(int head, int dependent, String relation) Validates the arc invariants. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thedependentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inthead()Returns the value of theheadrecord component.relation()Returns the value of therelationrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
ROOT_HEAD
public static final int ROOT_HEADTheheadvalue marking an arc from the artificial root node.- See Also:
-
-
Constructor Details
-
DependencyArc
Validates the arc invariants.- Throws:
IllegalArgumentException- Thrown ifdependentis negative,headis less thanROOT_HEAD, the arc is a self-loop, orrelationisnullor blank.
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
head
-
dependent
-
relation
-