Index (Apache OpenNLP :: Core :: Runtime 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.dictionary, class: Index

Package opennlp.tools.dictionary

# Class Index

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

public class Index extends Object
This classes indexes `string lists`. This makes it possible to check if a certain token is contained in at least one of the `StringList`s.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Index(Iterator<StringList> tokenLists)`
  Initializes an `Index` with the given `Iterator` over `StringList` elements.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `contains(String token)`
  Checks if at least one `StringList` contains the specified `token`.

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

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

- ## Constructor Details

  - ### Index

    public Index(Iterator<StringList> tokenLists)
    Initializes an `Index` with the given `Iterator` over `StringList` elements.
    Parameters:
      `tokenLists` - The iterable `StringList` elements.

- ## Method Details

  - ### contains

    public boolean contains(String token)
    Checks if at least one `StringList` contains the specified `token`.
    Parameters:
      `token` - The element to check for.
    Returns:
      `true` if the token is contained, `false` otherwise.