SMILA (incubation) API documentation

org.eclipse.smila.search.lucene.index
Class AnnotationFormatter

java.lang.Object
  extended by org.eclipse.smila.search.lucene.index.AnnotationFormatter

public class AnnotationFormatter
extends java.lang.Object

Implementation of a lucene Formatter that creates highlighting annotations.


Constructor Summary
AnnotationFormatter(DataFactory factory)
          Conversion constructor.
 
Method Summary
 AnySeq getHighlightPositions()
          Returns the highlight positions.
 java.lang.String getOriginalText()
          Return the original text.
 java.lang.String highlightTerm(java.lang.String originalText, TokenGroup tokenGroup)
          
 void reset(java.lang.String originalText)
          Reset this formatter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationFormatter

public AnnotationFormatter(DataFactory factory)
Conversion constructor.

Parameters:
factory - the RecordFactory to use.
Method Detail

highlightTerm

public java.lang.String highlightTerm(java.lang.String originalText,
                                      TokenGroup tokenGroup)

See Also:
org.apache.lucene.search.highlight.Formatter#highlightTerm(String, TokenGroup)

reset

public void reset(java.lang.String originalText)
Reset this formatter.

Parameters:
originalText - the original text

getHighlightPositions

public AnySeq getHighlightPositions()
Returns the highlight positions.

Returns:
a list of highligth position annotations

getOriginalText

public java.lang.String getOriginalText()
Return the original text.

Returns:
the original text

SMILA (incubation) API documentation