class LuceneRegexFragmenter
extends java.lang.Object
implements org.apache.lucene.search.highlight.Fragmenter
maxAnalyzedChars
is much lower for this
fragmenter. After this limit is exhausted, fragments are produced in the
same way as GapFragmenter
Modifier and Type | Field and Description |
---|---|
protected int |
currentNumFrags |
protected int |
currentOffset |
static int |
DEFAULT_FRAGMENT_SIZE |
static int |
DEFAULT_INCREMENT_GAP |
static int |
DEFAULT_MAX_ANALYZED_CHARS |
static java.util.regex.Pattern |
DEFAULT_PATTERN |
static java.lang.String |
DEFAULT_PATTERN_RAW |
static float |
DEFAULT_SLOP |
protected int[] |
hotspots |
protected int |
incrementGapThreshold |
protected int |
maxAnalyzedChars |
private org.apache.lucene.analysis.tokenattributes.OffsetAttribute |
offsetAtt |
private org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute |
posIncAtt |
protected float |
slop |
protected int |
targetFragChars |
protected int |
targetOffset |
protected java.util.regex.Pattern |
textRE |
Constructor and Description |
---|
LuceneRegexFragmenter() |
LuceneRegexFragmenter(int targetFragChars) |
LuceneRegexFragmenter(int targetFragChars,
int incrementGapThreshold,
float slop,
int maxAnalyzedChars) |
LuceneRegexFragmenter(int targetFragChars,
int incrementGapThreshold,
float slop,
int maxAnalyzedChars,
java.util.regex.Pattern targetPattern) |
Modifier and Type | Method and Description |
---|---|
protected void |
addHotSpots(java.lang.String text) |
boolean |
isNewFragment() |
void |
start(java.lang.String originalText,
org.apache.lucene.analysis.TokenStream tokenStream) |
public static final int DEFAULT_FRAGMENT_SIZE
public static final int DEFAULT_INCREMENT_GAP
public static final float DEFAULT_SLOP
public static final int DEFAULT_MAX_ANALYZED_CHARS
protected int targetFragChars
protected int incrementGapThreshold
protected float slop
protected int maxAnalyzedChars
protected java.util.regex.Pattern textRE
protected int currentNumFrags
protected int currentOffset
protected int targetOffset
protected int[] hotspots
private org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute posIncAtt
private org.apache.lucene.analysis.tokenattributes.OffsetAttribute offsetAtt
public static final java.lang.String DEFAULT_PATTERN_RAW
public static final java.util.regex.Pattern DEFAULT_PATTERN
public LuceneRegexFragmenter()
public LuceneRegexFragmenter(int targetFragChars)
public LuceneRegexFragmenter(int targetFragChars, int incrementGapThreshold, float slop, int maxAnalyzedChars)
public LuceneRegexFragmenter(int targetFragChars, int incrementGapThreshold, float slop, int maxAnalyzedChars, java.util.regex.Pattern targetPattern)
public void start(java.lang.String originalText, org.apache.lucene.analysis.TokenStream tokenStream)
start
in interface org.apache.lucene.search.highlight.Fragmenter
protected void addHotSpots(java.lang.String text)
public boolean isNewFragment()
isNewFragment
in interface org.apache.lucene.search.highlight.Fragmenter