LemmaSample (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.lemmatizer

## Class LemmaSample

- java.lang.Object
- - opennlp.tools.lemmatizer.LemmaSample

- All Implemented Interfaces:
    Serializable

      public class LemmaSample
      extends Object
      implements Serializable

  Represents an lemmatized sentence.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LemmaSample(List<String> tokens, List<String> tags, List<String> lemmas)` Lemma Sample constructor.
    `LemmaSample(String[] tokens, String[] tags, String[] lemmas)` Represents one lemma sample.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `String[]` | `getLemmas()`
    `String[]` | `getTags()`
    `String[]` | `getTokens()`
    `int` | `hashCode()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LemmaSample

          public LemmaSample(String[] tokens,
                             String[] tags,
                             String[] lemmas)

      Represents one lemma sample.
      Parameters:
        `tokens` - the token
        `tags` - the postags
        `lemmas` - the lemmas

    - #### LemmaSample

          public LemmaSample(List<String> tokens,
                             List<String> tags,
                             List<String> lemmas)

      Lemma Sample constructor.
      Parameters:
        `tokens` - the tokens
        `tags` - the postags
        `lemmas` - the lemmas

  - ### Method Detail

    - #### getTokens

          public String[] getTokens()

    - #### getTags

          public String[] getTags()

    - #### getLemmas

          public String[] getLemmas()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

Copyright © 2026 The Apache Software Foundation. All rights reserved.