TermFreqVector.java
01 package gate.creole.annic.apache.lucene.index;
02 
03 import java.io.IOException;
04 
05 /** Provides access to stored term vector of
06  *  a document field.
07  */
08 public interface TermFreqVector {
09   /**
10    *
11    @return The field this vector is associated with.
12    *
13    */
14   public String getField();
15 
16   /**
17    @return The number of terms in the term vector.
18    */
19   public int size();
20 
21   /**
22    @return An Array of term texts in ascending order.
23    */
24   public String[] getTerms();
25 
26 
27   /** Array of term frequencies. Locations of the array correspond one to one
28    *  to the terms in the array obtained from <code>getTerms</code>
29    *  method. Each location in the array contains the number of times this
30    *  term occurs in the document or the document field.
31    */
32   public int[] getTermFrequencies();
33 
34 
35   /** Return an index in the term numbers array returned from
36    *  <code>getTerms</code> at which the term with the specified
37    *  <code>term</code> appears. If this term does not appear in the array,
38    *  return -1.
39    */
40   public int indexOf(String term);
41 
42 
43   /** Just like <code>indexOf(int)</code> but searches for a number of terms
44    *  at the same time. Returns an array that has the same size as the number
45    *  of terms searched for, each slot containing the result of searching for
46    *  that term number.
47    *
48    *  @param terms array containing terms to look for
49    *  @param start index in the array where the list of terms starts
50    *  @param len the number of terms in the list
51    */
52   public int[] indexesOf(String[] terms, int start, int len);
53 
54 }