23 using System.Collections.Generic;
26 using Lucene.Net.Analysis;
27 using Lucene.Net.Analysis.Tokenattributes;
29 namespace Lucene.Net.Search.Highlight
33 private static int DEFAULT_FRAGMENT_SIZE = 100;
34 private int fragmentSize;
35 private int currentNumFrags;
36 private int position = -1;
38 private int waitForPos = -1;
46 : this(queryScorer, DEFAULT_FRAGMENT_SIZE)
55 this.fragmentSize = fragmentSize;
56 this.queryScorer = queryScorer;
60 public bool IsNewFragment()
62 position += posIncAtt.PositionIncrement;
64 if (waitForPos == position)
68 else if (waitForPos != -1)
75 if (wSpanTerm != null)
79 for (
int i = 0; i < positionSpans.Count; i++)
81 if (positionSpans[i].Start == position)
83 waitForPos = positionSpans[i].End + 1;
89 bool isNewFrag = offsetAtt.EndOffset >= (fragmentSize*currentNumFrags)
90 && (textSize - offsetAtt.EndOffset) >= ((uint) fragmentSize >> 1);
106 textSize = originalText.Length;