19 using System.Collections.Generic;
24 namespace Lucene.Net.Search.Vectorhighlight
32 public static int MARGIN = 6;
33 public static int MIN_FRAG_CHAR_SIZE = MARGIN * 3;
37 if (fragCharSize < MIN_FRAG_CHAR_SIZE)
38 throw new ArgumentException(
"fragCharSize(" + fragCharSize +
") is too small. It must be " +
39 MIN_FRAG_CHAR_SIZE +
" or higher.");
43 List<WeightedPhraseInfo> wpil =
new List<WeightedPhraseInfo>();
44 LinkedList<WeightedPhraseInfo>.Enumerator ite = fieldPhraseList.
phraseList.GetEnumerator();
53 if (!ite.MoveNext())
break;
54 phraseInfo = ite.Current;
57 if (phraseInfo == null)
break;
60 if (phraseInfo.StartOffset < startOffset)
continue;
64 int st = phraseInfo.StartOffset - MARGIN < startOffset ?
65 startOffset : phraseInfo.StartOffset - MARGIN;
66 int en = st + fragCharSize;
67 if (phraseInfo.EndOffset > en)
68 en = phraseInfo.EndOffset;
75 phraseInfo = ite.Current;
77 if (phraseInfo == null)
break;
81 if (phraseInfo.EndOffset <= en)
86 ffl.
Add(st, en, wpil);