Save This Page
Home » lucene-3.0.1-src » org.apache » lucene » search » highlight » [javadoc | source]
org.apache.lucene.search.highlight
public interface: Fragmenter [javadoc | source]

All Known Implementing Classes:
    SimpleFragmenter, SimpleSpanFragmenter, NullFragmenter

Implements the policy for breaking text into multiple fragments for consideration by the Highlighter class. A sophisticated implementation may do this on the basis of detecting end of sentences in the text.
Method from org.apache.lucene.search.highlight.Fragmenter Summary:
isNewFragment,   start
Method from org.apache.lucene.search.highlight.Fragmenter Detail:
 public boolean isNewFragment()
    Test to see if this token from the stream should be held in a new TextFragment. Every time this is called, the TokenStream passed to start(String, TokenStream) will have been incremented.
 public  void start(String originalText,
    TokenStream tokenStream)
    Initializes the Fragmenter. You can grab references to the Attributes you are interested in from tokenStream and then access the values in #isNewFragment() .