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 aThreadSafeTokenizerMEby downloading a default model for a givenlanguage.Initializes aThreadSafeTokenizerMEwith the specifiedmodel.ThreadSafeTokenizerME(TokenizerModel model, Dictionary abbDict) Instantiates aThreadSafeTokenizerMEwith an existingTokenizerModel. -
Methodenübersicht
-
Konstruktordetails
-
ThreadSafeTokenizerME
Initializes aThreadSafeTokenizerMEby 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 aThreadSafeTokenizerMEwith the specifiedmodel.- Parameter:
model- A validTokenizerModel.
-
ThreadSafeTokenizerME
Instantiates aThreadSafeTokenizerMEwith an existingTokenizerModel.- Parameter:
model- TheTokenizerModelto be used.abbDict- TheDictionaryto be used. It must fit the language of themodel.
-
-
Methodendetails
-
tokenize
Beschreibung aus Schnittstelle kopiert:TokenizerSplits a string into its atomic parts. -
tokenizePos
Beschreibung aus Schnittstelle kopiert:TokenizerFinds the boundaries of atomic parts in a string.- Angegeben von:
tokenizePosin SchnittstelleTokenizer- Parameter:
s- The string to be tokenized.- Gibt zurück:
- The
spans (offsets intofor each token as the individuals array elements.s)
-
getProbabilities
public double[] getProbabilities() -
close
public void close()- Angegeben von:
closein SchnittstelleAutoCloseable
-