Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
TermFreqVector.cs
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 using System;
19 using Lucene.Net.Documents;
20 
21 namespace Lucene.Net.Index
22 {
23 
24  /// <summary>Provides access to stored term vector of
25  /// a document field. The vector consists of the name of the field, an array of the terms tha occur in the field of the
26  /// <see cref="Lucene.Net.Documents.Document" /> and a parallel array of frequencies. Thus, getTermFrequencies()[5] corresponds with the
27  /// frequency of getTerms()[5], assuming there are at least 5 terms in the Document.
28  /// </summary>
29  public interface ITermFreqVector
30  {
31  /// <summary> The <see cref="IFieldable" /> name. </summary>
32  /// <value> The name of the field this vector is associated with. </value>
33  string Field { get; }
34 
35  /// <value> The number of terms in the term vector. </value>
36  int Size { get; }
37 
38  /// <returns> An Array of term texts in ascending order.
39  /// </returns>
40  System.String[] GetTerms();
41 
42 
43  /// <summary>Array of term frequencies. Locations of the array correspond one to one
44  /// to the terms in the array obtained from <c>getTerms</c>
45  /// method. Each location in the array contains the number of times this
46  /// term occurs in the document or the document field.
47  /// </summary>
48  int[] GetTermFrequencies();
49 
50 
51  /// <summary>Return an index in the term numbers array returned from
52  /// <c>getTerms</c> at which the term with the specified
53  /// <c>term</c> appears. If this term does not appear in the array,
54  /// return -1.
55  /// </summary>
56  int IndexOf(System.String term);
57 
58 
59  /// <summary>Just like <c>indexOf(int)</c> but searches for a number of terms
60  /// at the same time. Returns an array that has the same size as the number
61  /// of terms searched for, each slot containing the result of searching for
62  /// that term number.
63  ///
64  /// </summary>
65  /// <param name="terms">array containing terms to look for
66  /// </param>
67  /// <param name="start">index in the array where the list of terms starts
68  /// </param>
69  /// <param name="len">the number of terms in the list
70  /// </param>
71  int[] IndexesOf(System.String[] terms, int start, int len);
72  }
73 }