FileDocCategorySizeDatePackage
SimpleHTMLFormatter.javaAPI DocApache Lucene 1.91664Mon Feb 20 09:18:22 GMT 2006org.apache.lucene.search.highlight

SimpleHTMLFormatter

public class SimpleHTMLFormatter extends Object implements Formatter
Simple {@link Formatter} implementation to highlight terms with a pre and post tag
author
MAHarwood

Fields Summary
String
preTag
String
postTag
Constructors Summary
public SimpleHTMLFormatter(String preTag, String postTag)

		this.preTag = preTag;
		this.postTag = postTag;
	
public SimpleHTMLFormatter()
Default constructor uses HTML: <B> tags to markup terms

		this.preTag = "<B>";
		this.postTag = "</B>";
	
Methods Summary
public java.lang.StringhighlightTerm(java.lang.String originalText, TokenGroup tokenGroup)

		StringBuffer returnBuffer;
		if(tokenGroup.getTotalScore()>0)
		{
			returnBuffer=new StringBuffer();
			returnBuffer.append(preTag);
			returnBuffer.append(originalText);
			returnBuffer.append(postTag);
			return returnBuffer.toString();
		}
		return originalText;