19 using System.Collections.Generic;
20 using Lucene.Net.Support;
22 namespace Lucene.Net.Index
31 private IDictionary<string, IDictionary<int, TVPositionInfo>> fieldToTerms;
33 private System.String currentField;
35 private IDictionary<int, TVPositionInfo> currentPositions;
36 private bool storeOffsets;
48 public override bool IsIgnoringPositions
62 public override void Map(System.String term,
int frequency,
TermVectorOffsetInfo[] offsets,
int[] positions)
64 for (
int i = 0; i < positions.Length; i++)
66 System.Int32 posVal = positions[i];
71 currentPositions[posVal] = pos;
86 public override void SetExpectations(System.String field,
int numTerms,
bool storeOffsets,
bool storePositions)
88 if (storePositions ==
false)
90 throw new System.SystemException(
"You must store positions in order to use this Mapper");
92 if (storeOffsets ==
true)
96 fieldToTerms =
new HashMap<string, IDictionary<int, TVPositionInfo>>(numTerms);
97 this.storeOffsets = storeOffsets;
99 currentPositions =
new HashMap<int, TVPositionInfo>();
100 fieldToTerms[currentField] = currentPositions;
107 public virtual IDictionary<string, IDictionary<int, TVPositionInfo>> FieldToTerms
109 get {
return fieldToTerms; }
118 virtual public int Position
129 virtual public IList<String> Terms
141 virtual public IList<TermVectorOffsetInfo> Offsets
149 private int position;
151 private IList<string> terms;
153 private IList<TermVectorOffsetInfo> offsets;
158 this.position = position;
159 terms =
new List<string>();
162 offsets =
new List<TermVectorOffsetInfo>();