org.apache.lucene.search.highlight
Class SimpleSpanFragmenter

java.lang.Object
  extended by org.apache.lucene.search.highlight.SimpleSpanFragmenter
All Implemented Interfaces:
Fragmenter

public class SimpleSpanFragmenter
extends Object
implements Fragmenter

Fragmenter implementation which breaks text up into same-size fragments but does not split up Spans. This is a simple sample class.


Constructor Summary
SimpleSpanFragmenter(SpanScorer spanscorer)
           
SimpleSpanFragmenter(SpanScorer spanscorer, int fragmentSize)
           
 
Method Summary
 boolean isNewFragment(Token token)
          Test to see if this token from the stream should be held in a new TextFragment
 void start(String originalText)
          Initializes the Fragmenter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSpanFragmenter

public SimpleSpanFragmenter(SpanScorer spanscorer)
Parameters:
spanscorer - SpanScorer that was used to score hits

SimpleSpanFragmenter

public SimpleSpanFragmenter(SpanScorer spanscorer,
                            int fragmentSize)
Parameters:
spanscorer - SpanScorer that was used to score hits
fragmentSize - size in bytes of each fragment
Method Detail

isNewFragment

public boolean isNewFragment(Token token)
Description copied from interface: Fragmenter
Test to see if this token from the stream should be held in a new TextFragment

Specified by:
isNewFragment in interface Fragmenter

start

public void start(String originalText)
Description copied from interface: Fragmenter
Initializes the Fragmenter

Specified by:
start in interface Fragmenter


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