21 namespace Lucene.Net.Search.Highlight
32 private static readonly String TEMPLATE =
"<span style=\"background: #EEEEEE; color: #000000;\">...</span>";
33 private static readonly
int EXTRA = TEMPLATE.Length;
36 String maxForegroundColor, String minBackgroundColor,
37 String maxBackgroundColor)
38 : base(maxScore, minForegroundColor, maxForegroundColor, minBackgroundColor, maxBackgroundColor)
41 public override String HighlightTerm(String originalText,
TokenGroup tokenGroup)
52 var sb =
new StringBuilder(originalText.Length + EXTRA);
54 sb.Append(
"<span style=\"");
55 if (highlightForeground)
58 sb.Append(GetForegroundColorString(score));
61 if (highlightBackground)
63 sb.Append(
"background: ");
64 sb.Append(GetBackgroundColorString(score));
68 sb.Append(originalText);