Class SpanGradientFormatter
- java.lang.Object
-
- org.apache.lucene.search.highlight.GradientFormatter
-
- org.apache.lucene.search.highlight.SpanGradientFormatter
-
- All Implemented Interfaces:
Formatter
public class SpanGradientFormatter extends GradientFormatter
Formats text with different color intensity depending on the score of the term using the span tag. GradientFormatter uses a bgcolor argument to the font tag which doesn't work in Mozilla, thus this class.- See Also:
GradientFormatter
-
-
Field Summary
Fields Modifier and Type Field Description private static intEXTRAprivate static java.lang.StringTEMPLATE-
Fields inherited from class org.apache.lucene.search.highlight.GradientFormatter
bgBMax, bgBMin, bgGMax, bgGMin, bgRMax, bgRMin, fgBMax, fgBMin, fgGMax, fgGMin, fgRMax, fgRMin, highlightBackground, highlightForeground
-
-
Constructor Summary
Constructors Constructor Description SpanGradientFormatter(float maxScore, java.lang.String minForegroundColor, java.lang.String maxForegroundColor, java.lang.String minBackgroundColor, java.lang.String maxBackgroundColor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringhighlightTerm(java.lang.String originalText, TokenGroup tokenGroup)-
Methods inherited from class org.apache.lucene.search.highlight.GradientFormatter
getBackgroundColorString, getForegroundColorString, hexToInt
-
-
-
-
Field Detail
-
TEMPLATE
private static final java.lang.String TEMPLATE
- See Also:
- Constant Field Values
-
EXTRA
private static final int EXTRA
-
-
Method Detail
-
highlightTerm
public java.lang.String highlightTerm(java.lang.String originalText, TokenGroup tokenGroup)- Specified by:
highlightTermin interfaceFormatter- Overrides:
highlightTermin classGradientFormatter- Parameters:
originalText- The section of text being considered for markuptokenGroup- contains one or several overlapping Tokens along with their scores and positions.
-
-