Package ir_course

Source Code of ir_course.VSMSearcher

package ir_course;

import java.io.IOException;

import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.search.similarities.DefaultSimilarityProvider;
import org.apache.lucene.store.Directory;

public class VSMSearcher extends Searcher {
 
  public VSMSearcher(Directory index) {
    super(index);
  }

  public SearchResults VSMsearch(String query, int limit)
      throws CorruptIndexException, IOException {
   
    // Implements similarity with the Vector Space Model
    DefaultSimilarityProvider provider = new DefaultSimilarityProvider();
    this.setSimilarityProvider(provider);

    return this.search(query, limit);
  }

}
TOP

Related Classes of ir_course.VSMSearcher

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.