Package opennlp.tools.postag
Klasse ThreadSafePOSTaggerME
java.lang.Object
opennlp.tools.postag.ThreadSafePOSTaggerME
- Alle implementierten Schnittstellen:
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.- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungThreadSafePOSTaggerME(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. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidclose()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.
-
Konstruktordetails
-
ThreadSafePOSTaggerME
Initializes aThreadSafePOSTaggerMEby downloading a default model for a givenlanguage.- Parameter:
language- An ISO conform language code.- Löst aus:
IOException- Thrown if the model could not be downloaded or saved.
-
ThreadSafePOSTaggerME
Initializes aThreadSafePOSTaggerMEby downloading a default model for a givenlanguage.- Parameter:
language- An ISO conform language code.format- A validPOSTagFormat.- Löst aus:
IOException- Thrown if the model could not be downloaded or saved.
-
ThreadSafePOSTaggerME
Initializes aThreadSafePOSTaggerMEwith the specifiedmodel.- Parameter:
model- A validPOSModel.
-
ThreadSafePOSTaggerME
Initializes aThreadSafePOSTaggerMEwith the specifiedmodel.- Parameter:
model- A validPOSModel.format- A validPOSTagFormat.
-
-
Methodendetails
-
tag
Beschreibung aus Schnittstelle kopiert:POSTaggerAssigns the sentence of tokens pos tags. -
tag
Beschreibung aus Schnittstelle kopiert:POSTaggerAssigns the sentence of tokens pos tags. -
topKSequences
Beschreibung aus Schnittstelle kopiert:POSTaggerAssigns the sentence the top-ksequences.- Angegeben von:
topKSequencesin SchnittstellePOSTagger- Parameter:
sentence- The sentence of tokens to be tagged.- Gibt zurück:
- An array of
sequencesfor each token provided insentence.
-
topKSequences
Beschreibung aus Schnittstelle kopiert:POSTaggerAssigns the sentence the top-ksequences.- Angegeben von:
topKSequencesin SchnittstellePOSTagger- Parameter:
sentence- The sentence of tokens to be tagged.additionaContext- The context to provide additional information with.- Gibt zurück:
- An array of
sequencesfor each token provided insentence.
-
close
public void close()- Angegeben von:
closein SchnittstelleAutoCloseable
-