org.apache.lucene.search.highlight
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
Constructor Summary |
SpanGradientFormatter(float maxScore,
java.lang.String minForegroundColor,
java.lang.String maxForegroundColor,
java.lang.String minBackgroundColor,
java.lang.String maxBackgroundColor)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpanGradientFormatter
public SpanGradientFormatter(float maxScore,
java.lang.String minForegroundColor,
java.lang.String maxForegroundColor,
java.lang.String minBackgroundColor,
java.lang.String maxBackgroundColor)
highlightTerm
public java.lang.String highlightTerm(java.lang.String originalText,
TokenGroup tokenGroup)
- Specified by:
highlightTerm
in interface Formatter
- Overrides:
highlightTerm
in class GradientFormatter
- Parameters:
originalText
- The section of text being considered for markuptokenGroup
- contains one or several overlapping Tokens along with
their scores and positions.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.