Interface Fragmenter
-
- All Known Implementing Classes:
NullFragmenter
,SimpleFragmenter
,SimpleSpanFragmenter
public interface Fragmenter
Implements the policy for breaking text into multiple fragments for consideration by theHighlighter
class. A sophisticated implementation may do this on the basis of detecting end of sentences in the text.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isNewFragment()
Test to see if this token from the stream should be held in a new TextFragment.void
start(java.lang.String originalText, TokenStream tokenStream)
Initializes the Fragmenter.
-
-
-
Method Detail
-
start
void start(java.lang.String originalText, TokenStream tokenStream)
Initializes the Fragmenter. You can grab references to the Attributes you are interested in from tokenStream and then access the values inisNewFragment()
.- Parameters:
originalText
- the original source texttokenStream
- theTokenStream
to be fragmented
-
isNewFragment
boolean isNewFragment()
Test to see if this token from the stream should be held in a new TextFragment. Every time this is called, the TokenStream passed to start(String, TokenStream) will have been incremented.
-
-