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 aThreadSafePOSTaggerME
by downloading a default model for a givenlanguage
.ThreadSafePOSTaggerME
(String language, POSTagFormat format) Initializes aThreadSafePOSTaggerME
by downloading a default model for a givenlanguage
.ThreadSafePOSTaggerME
(POSModel model) Initializes aThreadSafePOSTaggerME
with the specifiedmodel
.ThreadSafePOSTaggerME
(POSModel model, POSTagFormat format) Initializes aThreadSafePOSTaggerME
with the specifiedmodel
. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
close()
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 aThreadSafePOSTaggerME
by 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 aThreadSafePOSTaggerME
by 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 aThreadSafePOSTaggerME
with the specifiedmodel
.- Parameter:
model
- A validPOSModel
.
-
ThreadSafePOSTaggerME
Initializes aThreadSafePOSTaggerME
with the specifiedmodel
.- Parameter:
model
- A validPOSModel
.format
- A validPOSTagFormat
.
-
-
Methodendetails
-
tag
Beschreibung aus Schnittstelle kopiert:POSTagger
Assigns the sentence of tokens pos tags. -
tag
Beschreibung aus Schnittstelle kopiert:POSTagger
Assigns the sentence of tokens pos tags. -
topKSequences
Beschreibung aus Schnittstelle kopiert:POSTagger
Assigns the sentence the top-ksequences
.- Angegeben von:
topKSequences
in SchnittstellePOSTagger
- Parameter:
sentence
- The sentence of tokens to be tagged.- Gibt zurück:
- An array of
sequences
for each token provided insentence
.
-
topKSequences
Beschreibung aus Schnittstelle kopiert:POSTagger
Assigns the sentence the top-ksequences
.- Angegeben von:
topKSequences
in SchnittstellePOSTagger
- Parameter:
sentence
- The sentence of tokens to be tagged.additionaContext
- The context to provide additional information with.- Gibt zurück:
- An array of
sequences
for each token provided insentence
.
-
close
public void close()- Angegeben von:
close
in SchnittstelleAutoCloseable
-