18 using System.Collections.Generic;
19 using Lucene.Net.Support;
21 namespace Lucene.Net.Index
30 private readonly IDictionary<string, SortedSet<TermVectorEntry>> fieldToTerms =
new HashMap<string, SortedSet<TermVectorEntry>>();
31 private SortedSet<TermVectorEntry> currentSet;
32 private System.String currentField;
33 private readonly IComparer<TermVectorEntry> comparator;
39 : this(false, false, comparator)
45 : base(ignoringPositions, ignoringOffsets)
47 this.comparator = comparator;
50 public override void Map(System.String term,
int frequency,
TermVectorOffsetInfo[] offsets,
int[] positions)
52 var entry =
new TermVectorEntry(currentField, term, frequency, offsets, positions);
53 currentSet.Add(entry);
56 public override void SetExpectations(System.String field,
int numTerms,
bool storeOffsets,
bool storePositions)
58 currentSet =
new SortedSet<TermVectorEntry>(comparator);
60 fieldToTerms[field] = currentSet;
67 public virtual IDictionary<string, SortedSet<TermVectorEntry>> FieldToTerms
69 get {
return fieldToTerms; }
73 public virtual IComparer<TermVectorEntry> Comparator
75 get {
return comparator; }