Show / Hide Table of Contents

    Class GradientFormatter

    Formats text with different color intensity depending on the score of the term.

    Inheritance
    System.Object
    GradientFormatter
    SpanGradientFormatter
    Implements
    IFormatter
    Namespace: Lucene.Net.Search.Highlight
    Assembly: Lucene.Net.Highlighter.dll
    Syntax
    public class GradientFormatter : object, IFormatter

    Constructors

    | Improve this Doc View Source

    GradientFormatter(Single, String, String, String, String)

    Sets the color range for the IDF scores

    Declaration
    public GradientFormatter(float maxScore, string minForegroundColor, string maxForegroundColor, string minBackgroundColor, string maxBackgroundColor)
    Parameters
    Type Name Description
    System.Single maxScore

    The score (and above) displayed as maxColor (See MaxTermWeight which can be used to callibrate scoring scale)

    System.String minForegroundColor

    The hex color used for representing IDF scores of zero eg

    FFFFFF (white) or null if no foreground color required

    System.String maxForegroundColor

    The largest hex color used for representing IDF scores eg

    000000 (black) or null if no foreground color required

    System.String minBackgroundColor

    The hex color used for representing IDF scores of zero eg

    FFFFFF (white) or null if no background color required

    System.String maxBackgroundColor

    The largest hex color used for representing IDF scores eg

    000000 (black) or null if no background color required

    Fields

    | Improve this Doc View Source

    m_bgBMax

    Declaration
    protected int m_bgBMax
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_bgBMin

    Declaration
    protected int m_bgBMin
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_bgGMax

    Declaration
    protected int m_bgGMax
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_bgGMin

    Declaration
    protected int m_bgGMin
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_bgRMax

    Declaration
    protected int m_bgRMax
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_bgRMin

    Declaration
    protected int m_bgRMin
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_fgBMax

    Declaration
    protected int m_fgBMax
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_fgBMin

    Declaration
    protected int m_fgBMin
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_fgGMax

    Declaration
    protected int m_fgGMax
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_fgGMin

    Declaration
    protected int m_fgGMin
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_fgRMax

    Declaration
    protected int m_fgRMax
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_fgRMin

    Declaration
    protected int m_fgRMin
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_highlightBackground

    Declaration
    protected bool m_highlightBackground
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    m_highlightForeground

    Declaration
    protected bool m_highlightForeground
    Field Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    GetBackgroundColorString(Single)

    Declaration
    protected virtual string GetBackgroundColorString(float score)
    Parameters
    Type Name Description
    System.Single score
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetForegroundColorString(Single)

    Declaration
    protected virtual string GetForegroundColorString(float score)
    Parameters
    Type Name Description
    System.Single score
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    HexToInt32(String)

    Converts a hex string into an .

    NOTE: This was hexToInt() in Lucene

    Declaration
    public static int HexToInt32(string hex)
    Parameters
    Type Name Description
    System.String hex

    A string in capital or lower case hex, of no more then 16 characters.

    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    HighlightTerm(String, TokenGroup)

    Declaration
    public virtual string HighlightTerm(string originalText, TokenGroup tokenGroup)
    Parameters
    Type Name Description
    System.String originalText
    TokenGroup tokenGroup
    Returns
    Type Description
    System.String

    Implements

    IFormatter
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)