Formats text with different color intensity depending on the score of the term.
More...
Inherits Lucene.Net.Search.Highlight.IFormatter.
Inherited by Lucene.Net.Search.Highlight.SpanGradientFormatter.
|
| GradientFormatter (float maxScore, string minForegroundColor, string maxForegroundColor, string minBackgroundColor, string maxBackgroundColor) |
| Sets the color range for the IDF scores
|
|
virtual string | HighlightTerm (string originalText, TokenGroup tokenGroup) |
|
string | HighlightTerm (System.String originalText, TokenGroup tokenGroup) |
|
|
static int | HexToInt (string hex) |
| 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.
|
|
Formats text with different color intensity depending on the score of the term.
Definition at line 25 of file GradientFormatter.cs.
Lucene.Net.Search.Highlight.GradientFormatter.GradientFormatter |
( |
float |
maxScore, |
|
|
string |
minForegroundColor, |
|
|
string |
maxForegroundColor, |
|
|
string |
minBackgroundColor, |
|
|
string |
maxBackgroundColor |
|
) |
| |
Sets the color range for the IDF scores
- Parameters
-
maxScore | The score (and above) displayed as maxColor (See QueryScorer.getMaxWeight which can be used to callibrate scoring scale) |
minForegroundColor | The hex color used for representing IDF scores of zero eg #FFFFFF (white) or null if no foreground color required |
maxForegroundColor | The largest hex color used for representing IDF scores eg #000000 (black) or null if no foreground color required |
minBackgroundColor | The hex color used for representing IDF scores of zero eg #FFFFFF (white) or null if no background color required |
maxBackgroundColor | The largest hex color used for representing IDF scores eg #000000 (black) or null if no background color required |
Definition at line 57 of file GradientFormatter.cs.
static int Lucene.Net.Search.Highlight.GradientFormatter.HexToInt |
( |
string |
hex | ) |
|
|
static |
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.
- Parameters
-
hex | A string in capital or lower case hex, of no more then 16 characters. |
- Exceptions
-
FormatException | if the string is more than 16 characters long, or if any character is not in the set [0-9a-fA-f] |
Definition at line 194 of file GradientFormatter.cs.
virtual string Lucene.Net.Search.Highlight.GradientFormatter.HighlightTerm |
( |
string |
originalText, |
|
|
TokenGroup |
tokenGroup |
|
) |
| |
|
virtual |
bool Lucene.Net.Search.Highlight.GradientFormatter.highlightBackground |
|
protected |
bool Lucene.Net.Search.Highlight.GradientFormatter.highlightForeground |
|
protected |
The documentation for this class was generated from the following file: