View Javadoc

1   package org.kit.furia;
2   
3   import org.ajmm.obsearch.ob.OBShort;
4   import org.kit.furia.exceptions.IRException;
5   
6   import java.util.List;
7   
8   /*
9    Furia-chan: An Open Source software license violation detector.
10   Copyright (C) 2007 Kyushu Institute of Technology
11  
12   This program is free software: you can redistribute it and/or modify
13   it under the terms of the GNU General Public License as published by
14   the Free Software Foundation, either version 3 of the License, or
15   (at your option) any later version.
16  
17   This program is distributed in the hope that it will be useful,
18   but WITHOUT ANY WARRANTY; without even the implied warranty of
19   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20   GNU General Public License for more details.
21  
22   You should have received a copy of the GNU General Public License
23   along with this program.  If not, see <http://www.gnu.org/licenses/>.
24   */
25  
26  /**
27   * An IRIndex that can store documents composed of Objects OBShort.
28   * @author Arnoldo Jose Muller Molina
29   * @param <
30   *                O > The OB object that composes the documents to be stored.
31   * @since 0
32   */
33  public interface IRIndexShort < O extends OBShort > extends IRIndex < O > {
34  
35      /**
36       * Searches the top n documents that are closest to document. For each
37       * "word" (element) that composes document, at most k closest objects will
38       * be returned, and all of the returned objects will be used to create the
39       * query. The k
40       * @param document
41       *                A multi-set of objects OBShort.
42       * @param k
43       *                k for the nearest neighbor search. All the k-elements will be used to create the IR query.
44       * @param r
45       *                range for the nearest neighbor search
46       * @param n
47       *                Maximum # of elements to return
48       * @throws IRException
49       *                If something goes really wrong.
50       * @return The closest elements to document. The leftmost document is the
51       *         closest document.
52       */
53      public List < ResultCandidate > search(Document < O > document, byte k, short r,
54              short n) throws IRException;
55  
56  }