Class ThreadSafePOSTaggerME

java.lang.Object
opennlp.tools.postag.ThreadSafePOSTaggerME
All Implemented Interfaces:
AutoCloseable, opennlp.tools.ml.Probabilistic, opennlp.tools.postag.POSTagger

@Deprecated(since="3.0.0") @ThreadSafe public class ThreadSafePOSTaggerME extends Object implements opennlp.tools.postag.POSTagger, opennlp.tools.ml.Probabilistic, AutoCloseable
Deprecated.
As of OPENNLP-1816, POSTaggerME is itself thread-safe. Use it directly instead.
A thread-safe version of the POSTaggerME. 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 POSTaggerME 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

    • tag

      public String[] tag(String[] sentence)
      Deprecated.
      Specified by:
      tag in interface opennlp.tools.postag.POSTagger
    • tag

      public String[] tag(String[] sentence, Object[] additionaContext)
      Deprecated.
      Specified by:
      tag in interface opennlp.tools.postag.POSTagger
    • topKSequences

      public opennlp.tools.util.Sequence[] topKSequences(String[] sentence)
      Deprecated.
      Specified by:
      topKSequences in interface opennlp.tools.postag.POSTagger
    • topKSequences

      public opennlp.tools.util.Sequence[] topKSequences(String[] sentence, Object[] additionaContext)
      Deprecated.
      Specified by:
      topKSequences in interface opennlp.tools.postag.POSTagger
    • probs

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

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