Record Class MecabDictionary.WordEntry

java.lang.Object
java.lang.Record
opennlp.tools.tokenize.lattice.MecabDictionary.WordEntry
Record Components:
leftId - The left context id, an index into the connection matrix.
rightId - The right context id, an index into the connection matrix.
cost - The entry's own cost.
features - The entry's feature columns, in file order.
Enclosing class:
MecabDictionary

static record MecabDictionary.WordEntry(int leftId, int rightId, int cost, List<String> features) extends Record
One lexicon or unknown-word entry.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The field for the cost record component.
    private final List<String>
    The field for the features record component.
    private final int
    The field for the leftId record component.
    private final int
    The field for the rightId record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WordEntry(int leftId, int rightId, int cost, List<String> features)
    Creates an instance of a WordEntry record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the cost record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the features record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the leftId record component.
    int
    Returns the value of the rightId record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • leftId

      private final int leftId
      The field for the leftId record component.
    • rightId

      private final int rightId
      The field for the rightId record component.
    • cost

      private final int cost
      The field for the cost record component.
    • features

      private final List<String> features
      The field for the features record component.
  • Constructor Details

    • WordEntry

      WordEntry(int leftId, int rightId, int cost, List<String> features)
      Creates an instance of a WordEntry record class.
      Parameters:
      leftId - the value for the leftId record component
      rightId - the value for the rightId record component
      cost - the value for the cost record component
      features - the value for the features record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • leftId

      public int leftId()
      Returns the value of the leftId record component.
      Returns:
      the value of the leftId record component
    • rightId

      public int rightId()
      Returns the value of the rightId record component.
      Returns:
      the value of the rightId record component
    • cost

      public int cost()
      Returns the value of the cost record component.
      Returns:
      the value of the cost record component
    • features

      public List<String> features()
      Returns the value of the features record component.
      Returns:
      the value of the features record component