Package opennlp.tools.postag
Class ThreadSafePOSTaggerME
java.lang.Object
opennlp.tools.postag.ThreadSafePOSTaggerME
- All Implemented Interfaces:
- AutoCloseable,- POSTagger
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.- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionThreadSafePOSTaggerME(String language) Initializes aThreadSafePOSTaggerMEby downloading a default model for a givenlanguage.ThreadSafePOSTaggerME(String language, POSTagFormat format) Initializes aThreadSafePOSTaggerMEby downloading a default model for a givenlanguage.ThreadSafePOSTaggerME(POSModel model) Initializes aThreadSafePOSTaggerMEwith the specifiedmodel.ThreadSafePOSTaggerME(POSModel model, POSTagFormat format) Initializes aThreadSafePOSTaggerMEwith the specifiedmodel.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()String[]Assigns the sentence of tokens pos tags.String[]Assigns the sentence of tokens pos tags.Sequence[]topKSequences(String[] sentence) Assigns the sentence the top-ksequences.Sequence[]topKSequences(String[] sentence, Object[] additionaContext) Assigns the sentence the top-ksequences.
- 
Constructor Details- 
ThreadSafePOSTaggerMEInitializes 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.
 
- 
ThreadSafePOSTaggerMEInitializes aThreadSafePOSTaggerMEby downloading a default model for a givenlanguage.- Parameters:
- language- An ISO conform language code.
- format- A valid- POSTagFormat.
- Throws:
- IOException- Thrown if the model could not be downloaded or saved.
 
- 
ThreadSafePOSTaggerMEInitializes aThreadSafePOSTaggerMEwith the specifiedmodel.- Parameters:
- model- A valid- POSModel.
 
- 
ThreadSafePOSTaggerMEInitializes aThreadSafePOSTaggerMEwith the specifiedmodel.- Parameters:
- model- A valid- POSModel.
- format- A valid- POSTagFormat.
 
 
- 
- 
Method Details- 
tagDescription copied from interface:POSTaggerAssigns the sentence of tokens pos tags.
- 
tagDescription copied from interface:POSTaggerAssigns the sentence of tokens pos tags.
- 
topKSequencesDescription copied from interface:POSTaggerAssigns the sentence the top-ksequences.- Specified by:
- topKSequencesin interface- POSTagger
- Parameters:
- sentence- The sentence of tokens to be tagged.
- Returns:
- An array of sequencesfor each token provided insentence.
 
- 
topKSequencesDescription copied from interface:POSTaggerAssigns the sentence the top-ksequences.- Specified by:
- topKSequencesin interface- POSTagger
- Parameters:
- sentence- The sentence of tokens to be tagged.
- additionaContext- The context to provide additional information with.
- Returns:
- An array of sequencesfor each token provided insentence.
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
 
 
-