Class SentenceSplitter
java.lang.Object
com.redis.vl.extensions.summarization.SentenceSplitter
OpenNLP-based sentence splitting utility. Thread-safe after initialization.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a sentence splitter using the default English model.SentenceSplitter(opennlp.tools.sentdetect.SentenceModel model) Create a sentence splitter with a custom model. -
Method Summary
-
Constructor Details
-
SentenceSplitter
public SentenceSplitter()Create a sentence splitter using the default English model. The model is loaded from the classpath. -
SentenceSplitter
public SentenceSplitter(opennlp.tools.sentdetect.SentenceModel model) Create a sentence splitter with a custom model.- Parameters:
model- The OpenNLP sentence model to use
-
-
Method Details
-
split
Split text into sentences.- Parameters:
text- The text to split- Returns:
- List of sentences
-
splitWithSpans
Split text into sentences with position spans.- Parameters:
text- The text to split- Returns:
- Array of Span objects with start/end positions
-