Class LengthGoalBreakIterator

java.lang.Object
java.text.BreakIterator
org.apache.lucene.search.uhighlight.LengthGoalBreakIterator
All Implemented Interfaces:
Cloneable

public class LengthGoalBreakIterator extends BreakIterator
Wraps another BreakIterator to skip past breaks that would result in passages that are too short. It's still possible to get a short passage but only at the very end of the input text.

Important: This is not a general purpose BreakIterator; it's only designed to work in a way compatible with the UnifiedHighlighter. Some assumptions are checked with Java assertions.

  • Field Details

    • baseIter

      private final BreakIterator baseIter
    • lengthGoal

      private final int lengthGoal
    • fragmentAlignment

      private final float fragmentAlignment
    • isMinimumLength

      private final boolean isMinimumLength
    • currentCache

      private int currentCache
  • Constructor Details

    • LengthGoalBreakIterator

      private LengthGoalBreakIterator(BreakIterator baseIter, int lengthGoal, float fragmentAlignment, boolean isMinimumLength, int currentCache)
  • Method Details