Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Lucene.Net.Search.Highlight.GradientFormatter Class Reference

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.

Public Member Functions

 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)
 
- Public Member Functions inherited from Lucene.Net.Search.Highlight.IFormatter
string HighlightTerm (System.String originalText, TokenGroup tokenGroup)
 

Static Public Member Functions

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.
 

Protected Attributes

bool highlightForeground
 
bool highlightBackground
 

Detailed Description

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

Definition at line 25 of file GradientFormatter.cs.

Constructor & Destructor Documentation

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
maxScoreThe score (and above) displayed as maxColor (See QueryScorer.getMaxWeight which can be used to callibrate scoring scale)
minForegroundColorThe hex color used for representing IDF scores of zero eg #FFFFFF (white) or null if no foreground color required
maxForegroundColorThe largest hex color used for representing IDF scores eg #000000 (black) or null if no foreground color required
minBackgroundColorThe hex color used for representing IDF scores of zero eg #FFFFFF (white) or null if no background color required
maxBackgroundColorThe 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.

Member Function Documentation

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
hexA string in capital or lower case hex, of no more then 16 characters.
Exceptions
FormatExceptionif 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

Definition at line 104 of file GradientFormatter.cs.

Member Data Documentation

bool Lucene.Net.Search.Highlight.GradientFormatter.highlightBackground
protected

Definition at line 34 of file GradientFormatter.cs.

bool Lucene.Net.Search.Highlight.GradientFormatter.highlightForeground
protected

Definition at line 31 of file GradientFormatter.cs.


The documentation for this class was generated from the following file: