Class 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 Detail

      • SpanGradientFormatter

        public SpanGradientFormatter​(float maxScore,
                                     String minForegroundColor,
                                     String maxForegroundColor,
                                     String minBackgroundColor,
                                     String maxBackgroundColor)
    • Method Detail

      • highlightTerm

        public String highlightTerm​(String originalText,
                                    TokenGroup tokenGroup)
        Specified by:
        highlightTerm in interface Formatter
        Overrides:
        highlightTerm in class GradientFormatter
        Parameters:
        originalText - The section of text being considered for markup
        tokenGroup - contains one or several overlapping Tokens along with their scores and positions.