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

opennlp.tools.dictionary

## Class Index

- java.lang.Object
- - opennlp.tools.dictionary.Index

-     public class Index
      extends Object

  This classes indexes `StringList`s. This makes it possible to check if a certain token is contained in at least one of the `StringList`s.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Index(Iterator<StringList> tokenLists)` Initializes the current instance with the given `StringList` `Iterator`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `contains(String token)` Checks if at leat one `StringList` contains the given token.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Index

          public Index(Iterator<StringList> tokenLists)

      Initializes the current instance with the given `StringList` `Iterator`.
      Parameters:
        `tokenLists` -

  - ### Method Detail

    - #### contains

          public boolean contains(String token)

      Checks if at leat one `StringList` contains the given token.
      Parameters:
        `token` -
      Returns:
        true if the token is contained otherwise false.

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