org.apache.lucene.search.highlight

Class SimpleHTMLFormatter

Implemented Interfaces:
Formatter

public class SimpleHTMLFormatter
extends Object
implements Formatter

Simple Formatter implementation to highlight terms with a pre and post tag
Author:
MAHarwood

Constructor Summary

SimpleHTMLFormatter()
Default constructor uses HTML: <B> tags to markup terms
SimpleHTMLFormatter(String preTag, String postTag)

Method Summary

String
highlightTerm(String originalText, TokenGroup tokenGroup)

Constructor Details

SimpleHTMLFormatter

public SimpleHTMLFormatter()
Default constructor uses HTML: <B> tags to markup terms

SimpleHTMLFormatter

public SimpleHTMLFormatter(String preTag,
                           String postTag)

Method Details

highlightTerm

public String highlightTerm(String originalText,
                            TokenGroup tokenGroup)
Specified by:
highlightTerm in interface Formatter
Parameters:
originalText - The section of text being considered for markup
tokenGroup - contains one or several overlapping Tokens along with their scores and positions.

Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.