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

Package opennlp.tools.chunker

# Class ThreadSafeChunkerME

java.lang.Object
opennlp.tools.chunker.ThreadSafeChunkerME

All Implemented Interfaces:
  `AutoCloseable`, `opennlp.tools.chunker.Chunker`, `opennlp.tools.ml.Probabilistic`

@Deprecated(since="3.0.0") @ThreadSafe public class ThreadSafeChunkerME extends Object implements opennlp.tools.chunker.Chunker, opennlp.tools.ml.Probabilistic, AutoCloseable
Deprecated.
As of OPENNLP-1816, `ChunkerME` is itself thread-safe. Use it directly instead.
A thread-safe version of the `ChunkerME`. Using it is completely transparent. You can use it in a single-threaded context as well, it only incurs a minimal overhead.

Note: This class is deprecated and now delegates to a single shared `ChunkerME` instance, which is thread-safe as of OPENNLP-1816. Calling `close()` clears the current thread's thread-local state for compatibility.

See Also:
  - `Chunker`
  - `ChunkerME`
  - `Probabilistic`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ThreadSafeChunkerME(ChunkerModel model)`
  Deprecated.
  Initializes a `ThreadSafeChunkerME` with the specified `model`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String[]`
  `chunk(String[] toks, String[] tags)`
  Deprecated.
  `opennlp.tools.util.Span[]`
  `chunkAsSpans(String[] toks, String[] tags)`
  Deprecated.
  `void`
  `close()`
  Deprecated.
  `double[]`
  `probs()`
  Deprecated.
  `opennlp.tools.util.Sequence[]`
  `topKSequences(String[] sentence, String[] tags)`
  Deprecated.
  `opennlp.tools.util.Sequence[]`
  `topKSequences(String[] sentence, String[] tags, double minSequenceScore)`
  Deprecated.

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

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

- ## Constructor Details

  - ### ThreadSafeChunkerME

    public ThreadSafeChunkerME(ChunkerModel model)
    Deprecated.
    Initializes a `ThreadSafeChunkerME` with the specified `model`.
    Parameters:
      `model` - A valid `ChunkerModel`.

- ## Method Details

  - ### chunk

    public String[] chunk(String[] toks, String[] tags)
    Deprecated.
    Specified by:
      `chunk` in interface `opennlp.tools.chunker.Chunker`

  - ### chunkAsSpans

    public opennlp.tools.util.Span[] chunkAsSpans(String[] toks, String[] tags)
    Deprecated.
    Specified by:
      `chunkAsSpans` in interface `opennlp.tools.chunker.Chunker`

  - ### topKSequences

    public opennlp.tools.util.Sequence[] topKSequences(String[] sentence, String[] tags)
    Deprecated.
    Specified by:
      `topKSequences` in interface `opennlp.tools.chunker.Chunker`

  - ### topKSequences

    public opennlp.tools.util.Sequence[] topKSequences(String[] sentence, String[] tags, double minSequenceScore)
    Deprecated.
    Specified by:
      `topKSequences` in interface `opennlp.tools.chunker.Chunker`

  - ### close

    public void close()
    Deprecated.
    Specified by:
      `close` in interface `AutoCloseable`

  - ### probs

    public double[] probs()
    Deprecated.
    Specified by:
      `probs` in interface `opennlp.tools.ml.Probabilistic`