C# Class Lucene.Net.Search.Highlight.GradientFormatter

Copyright 2002-2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Formats text with different color intensity depending on the score of the term.
Inheritance: Formatter
Afficher le fichier Open project: synhershko/lucene.net

Protected Properties

Свойство Type Description
bgRMax int
bgRMin int
fgRMax int
fgRMin int
highlightBackground bool
highlightForeground bool

Méthodes publiques

Méthode Description
GradientFormatter ( float maxScore, string minForegroundColor, string maxForegroundColor, string minBackgroundColor, string maxBackgroundColor ) : System

Sets the color range for the IDF scores

HexToInt ( string hex ) : int

Converts a hex string into an int. Integer.parseInt(hex, 16) assumes the input is nonnegative unless there is a preceding minus sign. This method reads the input as twos complement instead, so if the input is 8 bytes long, it will correctly restore a negative int produced by Integer.toHexString() but not neccesarily one produced by Integer.toString(x,16) since that method will produce a string like '-FF' for negative integer values.

HighlightTerm ( string originalText, Lucene.Net.Search.Highlight.TokenGroup tokenGroup ) : string

Méthodes protégées

Méthode Description
GetBackgroundColorString ( float score ) : string
GetForegroundColorString ( float score ) : string

Private Methods

Méthode Description
GetColorVal ( int colorMin, int colorMax, float score ) : int
IntToHex ( int i ) : string

Method Details

GetBackgroundColorString() protected méthode

protected GetBackgroundColorString ( float score ) : string
score float
Résultat string

GetForegroundColorString() protected méthode

protected GetForegroundColorString ( float score ) : string
score float
Résultat string

GradientFormatter() public méthode

Sets the color range for the IDF scores
public GradientFormatter ( float maxScore, string minForegroundColor, string maxForegroundColor, string minBackgroundColor, string maxBackgroundColor ) : System
maxScore float /// The score (and above) displayed as maxColor (See QueryScorer.getMaxWeight /// which can be used to callibrate scoring scale) ///
minForegroundColor string /// The hex color used for representing IDF scores of zero eg /// #FFFFFF (white) or null if no foreground color required ///
maxForegroundColor string /// The largest hex color used for representing IDF scores eg /// #000000 (black) or null if no foreground color required ///
minBackgroundColor string /// The hex color used for representing IDF scores of zero eg /// #FFFFFF (white) or null if no background color required ///
maxBackgroundColor string /// The largest hex color used for representing IDF scores eg /// #000000 (black) or null if no background color required ///
Résultat System

HexToInt() public static méthode

Converts a hex string into an int. Integer.parseInt(hex, 16) assumes the input is nonnegative unless there is a preceding minus sign. This method reads the input as twos complement instead, so if the input is 8 bytes long, it will correctly restore a negative int produced by Integer.toHexString() but not neccesarily one produced by Integer.toString(x,16) since that method will produce a string like '-FF' for negative integer values.
if the string is more than 16 characters long, or if any /// character is not in the set [0-9a-fA-f]
public static HexToInt ( string hex ) : int
hex string /// A string in capital or lower case hex, of no more then 16 /// characters. ///
Résultat int

HighlightTerm() public méthode

public HighlightTerm ( string originalText, Lucene.Net.Search.Highlight.TokenGroup tokenGroup ) : string
originalText string
tokenGroup Lucene.Net.Search.Highlight.TokenGroup
Résultat string

Property Details

bgRMax protected_oe property

protected int bgRMax
Résultat int

bgRMin protected_oe property

protected int bgRMin
Résultat int

fgRMax protected_oe property

protected int fgRMax
Résultat int

fgRMin protected_oe property

protected int fgRMin
Résultat int

highlightBackground protected_oe property

protected bool highlightBackground
Résultat bool

highlightForeground protected_oe property

protected bool highlightForeground
Résultat bool