Package opennlp.tools.tokenize
Klasse ThreadSafeTokenizerME
java.lang.Object
opennlp.tools.tokenize.ThreadSafeTokenizerME
- Alle implementierten Schnittstellen:
AutoCloseable
,Tokenizer
A thread-safe version of
TokenizerME
. 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
KonstruktorenKonstruktorBeschreibungThreadSafeTokenizerME
(String language) Initializes aThreadSafeTokenizerME
by downloading a default model for a givenlanguage
.Initializes aThreadSafeTokenizerME
with the specifiedmodel
.ThreadSafeTokenizerME
(TokenizerModel model, Dictionary abbDict) Instantiates aThreadSafeTokenizerME
with an existingTokenizerModel
. -
Methodenübersicht
-
Konstruktordetails
-
ThreadSafeTokenizerME
Initializes aThreadSafeTokenizerME
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.
-
ThreadSafeTokenizerME
Initializes aThreadSafeTokenizerME
with the specifiedmodel
.- Parameter:
model
- A validTokenizerModel
.
-
ThreadSafeTokenizerME
Instantiates aThreadSafeTokenizerME
with an existingTokenizerModel
.- Parameter:
model
- TheTokenizerModel
to be used.abbDict
- TheDictionary
to be used. It must fit the language of themodel
.
-
-
Methodendetails
-
tokenize
Beschreibung aus Schnittstelle kopiert:Tokenizer
Splits a string into its atomic parts. -
tokenizePos
Beschreibung aus Schnittstelle kopiert:Tokenizer
Finds the boundaries of atomic parts in a string.- Angegeben von:
tokenizePos
in SchnittstelleTokenizer
- Parameter:
s
- The string to be tokenized.- Gibt zurück:
- The
spans (offsets into
for each token as the individuals array elements.s
)
-
getProbabilities
public double[] getProbabilities() -
close
public void close()- Angegeben von:
close
in SchnittstelleAutoCloseable
-