Package opennlp.tools.tokenize
Record Class WordpieceEncoder.VocabularyMatch
java.lang.Object
java.lang.Record
opennlp.tools.tokenize.WordpieceEncoder.VocabularyMatch
- Enclosing class:
WordpieceEncoder
private static record WordpieceEncoder.VocabularyMatch(String piece, int id, int end)
extends Record
A vocabulary match and the exclusive end offset in normalized text.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateVocabularyMatch(String piece, int id, int end) Creates an instance of aVocabularyMatchrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.piece()Returns the value of thepiecerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
piece
The field for thepiecerecord component. -
id
private final int idThe field for theidrecord component. -
end
private final int endThe field for theendrecord component.
-
-
Constructor Details
-
VocabularyMatch
Creates an instance of aVocabularyMatchrecord class.- Parameters:
piece- the value for thepiecerecord componentid- the value for theidrecord componentend- the value for theendrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
piece
Returns the value of thepiecerecord component.- Returns:
- the value of the
piecerecord component
-
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
end
public int end()Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-