C# Класс 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.
Наследование: Formatter
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
bgRMax int
bgRMin int
fgRMax int
fgRMin int
highlightBackground bool
highlightForeground bool

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
GetBackgroundColorString ( float score ) : string
GetForegroundColorString ( float score ) : string

Приватные методы

Метод Описание
GetColorVal ( int colorMin, int colorMax, float score ) : int
IntToHex ( int i ) : string

Описание методов

GetBackgroundColorString() защищенный Метод

protected GetBackgroundColorString ( float score ) : string
score float
Результат string

GetForegroundColorString() защищенный Метод

protected GetForegroundColorString ( float score ) : string
score float
Результат string

GradientFormatter() публичный Метод

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 ///
Результат System

HexToInt() публичный статический Метод

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. ///
Результат int

HighlightTerm() публичный Метод

public HighlightTerm ( string originalText, Lucene.Net.Search.Highlight.TokenGroup tokenGroup ) : string
originalText string
tokenGroup Lucene.Net.Search.Highlight.TokenGroup
Результат string

Описание свойств

bgRMax защищенное свойство

protected int bgRMax
Результат int

bgRMin защищенное свойство

protected int bgRMin
Результат int

fgRMax защищенное свойство

protected int fgRMax
Результат int

fgRMin защищенное свойство

protected int fgRMin
Результат int

highlightBackground защищенное свойство

protected bool highlightBackground
Результат bool

highlightForeground защищенное свойство

protected bool highlightForeground
Результат bool