Package opennlp.tools.postag
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.
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 Summary
ConstructorsConstructorDescriptionThreadSafePOSTaggerME(String language) Deprecated.Initializes aThreadSafePOSTaggerMEby downloading a default model for a givenlanguage.ThreadSafePOSTaggerME(String language, POSTagFormat format) Deprecated.Initializes aThreadSafePOSTaggerMEby downloading a default model for a givenlanguage.ThreadSafePOSTaggerME(POSModel model) Deprecated.Initializes aThreadSafePOSTaggerMEwith the specifiedmodel.ThreadSafePOSTaggerME(POSModel model, POSTagFormat format) Deprecated.Initializes aThreadSafePOSTaggerMEwith the specifiedmodel. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated.double[]probs()Deprecated.String[]Deprecated.String[]Deprecated.opennlp.tools.util.Sequence[]topKSequences(String[] sentence) Deprecated.opennlp.tools.util.Sequence[]topKSequences(String[] sentence, Object[] additionaContext) Deprecated.
-
Constructor Details
-
ThreadSafePOSTaggerME
Deprecated.Initializes aThreadSafePOSTaggerMEby downloading a default model for a givenlanguage.- Parameters:
language- An ISO conform language code.- Throws:
IOException- Thrown if the model could not be downloaded or saved.
-
ThreadSafePOSTaggerME
Deprecated.Initializes aThreadSafePOSTaggerMEby downloading a default model for a givenlanguage.- Parameters:
language- An ISO conform language code.format- A validPOSTagFormat.- Throws:
IOException- Thrown if the model could not be downloaded or saved.
-
ThreadSafePOSTaggerME
Deprecated.Initializes aThreadSafePOSTaggerMEwith the specifiedmodel.- Parameters:
model- A validPOSModel.
-
ThreadSafePOSTaggerME
Deprecated.Initializes aThreadSafePOSTaggerMEwith the specifiedmodel.- Parameters:
model- A validPOSModel.format- A validPOSTagFormat.
-
-
Method Details
-
tag
Deprecated.- Specified by:
tagin interfaceopennlp.tools.postag.POSTagger
-
tag
Deprecated.- Specified by:
tagin interfaceopennlp.tools.postag.POSTagger
-
topKSequences
Deprecated.- Specified by:
topKSequencesin interfaceopennlp.tools.postag.POSTagger
-
topKSequences
Deprecated.- Specified by:
topKSequencesin interfaceopennlp.tools.postag.POSTagger
-
probs
public double[] probs()Deprecated.- Specified by:
probsin interfaceopennlp.tools.ml.Probabilistic
-
close
public void close()Deprecated.- Specified by:
closein interfaceAutoCloseable
-
POSTaggerMEis itself thread-safe. Use it directly instead.