20 namespace Lucene.Net.Index
26 private System.String field;
27 private System.String[] terms;
28 private int[] termFreqs;
30 internal SegmentTermVector(System.String field, System.String[] terms,
int[] termFreqs)
34 this.termFreqs = termFreqs;
39 public virtual string Field
44 public override System.String ToString()
46 System.Text.StringBuilder sb =
new System.Text.StringBuilder();
48 sb.Append(field).Append(
": ");
51 for (
int i = 0; i < terms.Length; i++)
55 sb.Append(terms[i]).Append(
'/').Append(termFreqs[i]);
63 public virtual int Size
65 get {
return terms == null ? 0 : terms.Length; }
68 public virtual System.String[] GetTerms()
73 public virtual int[] GetTermFrequencies()
78 public virtual int IndexOf(System.String termText)
82 int res = System.Array.BinarySearch(terms, termText, System.StringComparer.Ordinal);
83 return res >= 0?res:- 1;
86 public virtual int[] IndexesOf(System.String[] termNumbers,
int start,
int len)
93 int[] res =
new int[len];
95 for (
int i = 0; i < len; i++)
97 res[i] = IndexOf(termNumbers[start + i]);