public class SimpleSpanFragmenter extends Object implements Fragmenter
Fragmenter
implementation which breaks text up into same-size
fragments but does not split up Spans
. This is a simple sample class.Constructor and Description |
---|
SimpleSpanFragmenter(QueryScorer queryScorer) |
SimpleSpanFragmenter(QueryScorer queryScorer,
int fragmentSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
isNewFragment()
Test to see if this token from the stream should be held in a new
TextFragment.
|
void |
start(String originalText,
TokenStream tokenStream)
Initializes the Fragmenter.
|
public SimpleSpanFragmenter(QueryScorer queryScorer)
queryScorer
- QueryScorer that was used to score hitspublic SimpleSpanFragmenter(QueryScorer queryScorer, int fragmentSize)
queryScorer
- QueryScorer that was used to score hitsfragmentSize
- size in chars of each fragmentpublic boolean isNewFragment()
Fragmenter
isNewFragment
in interface Fragmenter
public void start(String originalText, TokenStream tokenStream)
Fragmenter
Fragmenter.isNewFragment()
.start
in interface Fragmenter
originalText
- the original source texttokenStream
- the TokenStream
to be fragmentedCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.