public class SimpleFragmenter extends Object implements Fragmenter
Fragmenter
implementation which breaks text up into same-size
fragments with no concerns over spotting sentence boundaries.Constructor and Description |
---|
SimpleFragmenter() |
SimpleFragmenter(int fragmentSize) |
Modifier and Type | Method and Description |
---|---|
int |
getFragmentSize() |
boolean |
isNewFragment()
Test to see if this token from the stream should be held in a new
TextFragment.
|
void |
setFragmentSize(int size) |
void |
start(String originalText,
TokenStream stream)
Initializes the Fragmenter.
|
public SimpleFragmenter()
public SimpleFragmenter(int fragmentSize)
fragmentSize
- size in number of characters of each fragmentpublic void start(String originalText, TokenStream stream)
Fragmenter
Fragmenter.isNewFragment()
.start
in interface Fragmenter
originalText
- the original source textstream
- the TokenStream
to be fragmentedpublic boolean isNewFragment()
Fragmenter
isNewFragment
in interface Fragmenter
public int getFragmentSize()
public void setFragmentSize(int size)
size
- size in characters of each fragmentCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.