Class GradientFormatter
Formats text with different color intensity depending on the score of the term.
Inheritance
System.Object
GradientFormatter
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.Highlighter.dll
public class GradientFormatter : IFormatter
Constructors
|
Improve this Doc
View Source
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
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
protected bool m_highlightBackground
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
protected bool m_highlightForeground
Field Value
Type |
Description |
System.Boolean |
|
Methods
|
Improve this Doc
View Source
Declaration
protected virtual string GetBackgroundColorString(float score)
Parameters
Type |
Name |
Description |
System.Single |
score |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Declaration
protected virtual string GetForegroundColorString(float score)
Parameters
Type |
Name |
Description |
System.Single |
score |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Converts a hex string into an System.Int32.
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 |
|
Exceptions
Type |
Condition |
System.FormatException |
if the string is more than 16 characters long, or if any
character is not in the set [0-9a-fA-f]
|
|
Improve this Doc
View Source
Converts a hex string at the specified index and length of hex
into an System.Int32.
NOTE: This was hexToInt() in Lucene
Declaration
public static int HexToInt32(string hex, int startIndex, int length)
Parameters
Type |
Name |
Description |
System.String |
hex |
A string in capital or lower case hex, of no more then 16
characters.
|
System.Int32 |
startIndex |
The index of the first character to begin parsing.
|
System.Int32 |
length |
The number of characters to parse.
|
Returns
Type |
Description |
System.Int32 |
|
Exceptions
Type |
Condition |
System.FormatException |
if the string is more than 16 characters long, or if any
character is not in the set [0-9a-fA-f]
|
System.ArgumentOutOfRangeException |
startIndex or length is less than zero.
-or-
startIndex and length refer to a location outside of hex .
|
|
Improve this Doc
View Source
Declaration
public virtual string HighlightTerm(string originalText, TokenGroup tokenGroup)
Parameters
Type |
Name |
Description |
System.String |
originalText |
|
TokenGroup |
tokenGroup |
|
Returns
Type |
Description |
System.String |
|
Implements