Package opennlp.tools.sentdetect
Klasse ThreadSafeSentenceDetectorME
java.lang.Object
opennlp.tools.sentdetect.ThreadSafeSentenceDetectorME
- Alle implementierten Schnittstellen:
AutoCloseable,SentenceDetector
@ThreadSafe
public class ThreadSafeSentenceDetectorME
extends Object
implements SentenceDetector, AutoCloseable
A thread-safe version of
SentenceDetectorME. 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
KonstruktorenKonstruktorBeschreibungThreadSafeSentenceDetectorME(String language) Initializes aThreadSafeSentenceDetectorMEby downloading a default model for a givenlanguage.Initializes aThreadSafeSentenceDetectorMEwith the specifiedmodel.ThreadSafeSentenceDetectorME(SentenceModel model, Dictionary abbDict) Instantiates aThreadSafeSentenceDetectorMEwith an existingSentenceModel. -
Methodenübersicht
-
Konstruktordetails
-
ThreadSafeSentenceDetectorME
Initializes aThreadSafeSentenceDetectorMEby 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.
-
ThreadSafeSentenceDetectorME
Initializes aThreadSafeSentenceDetectorMEwith the specifiedmodel.- Parameter:
model- A validSentenceModel.
-
ThreadSafeSentenceDetectorME
Instantiates aThreadSafeSentenceDetectorMEwith an existingSentenceModel.- Parameter:
model- TheSentenceModelto be used.abbDict- TheDictionaryto be used. It must fit the language of themodel.
-
-
Methodendetails
-
getSentenceProbabilities
public double[] getSentenceProbabilities() -
sentDetect
Beschreibung aus Schnittstelle kopiert:SentenceDetectorDetects sentences in a character sequence.- Angegeben von:
sentDetectin SchnittstelleSentenceDetector- Parameter:
s- TheCharSequencefor which sentences shall to be detected.- Gibt zurück:
- The String[] with the individual sentences as the array elements.
-
sentPosDetect
Beschreibung aus Schnittstelle kopiert:SentenceDetectorDetects sentences in a character sequence.- Angegeben von:
sentPosDetectin SchnittstelleSentenceDetector- Parameter:
s- TheCharSequencefor which sentences shall be detected.- Gibt zurück:
- The array of
spans(offsets intos) for each detected sentence as the individuals array elements.
-
close
public void close()- Angegeben von:
closein SchnittstelleAutoCloseable
-