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:
  • Constructor Details

  • 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