i try to implement LSA semantic search using TML library.here is my code where rep1 is a folder that i create and dossier is a folder where i put my txt documents.
public static void main(String[] args) throws Exception {
Repository repository = new Repository("C:\rep1");
repository.addDocumentsInFolder("C:/dossier");
System.out.println("Documents added to repository successfully!");
SearchResultsCorpus corpus = new SearchResultsCorpus("type:document");
corpus.getParameters().setTermSelectionCriterion(TermSelection.DF);
corpus.getParameters().setTermSelectionThreshold(0);
corpus.getParameters().setDimensionalityReduction(DimensionalityReduction.NUM);
corpus.getParameters().setDimensionalityReductionThreshold(50);
corpus.getParameters().setTermWeightGlobal(GlobalWeight.Entropy);
corpus.getParameters().setTermWeightLocal(LocalWeight.LOGTF);
corpus.load(repository);
System.out.println("Corpus loaded and Semantic space calculated");
System.out.println("Total documents:" + corpus.getPassages().length);
PassagesSimilarity distances = new PassagesSimilarity();
distances.setCorpus(corpus);
distances.start();
distances.printResults();
}
but I have this error!
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/index/CorruptIndexException
at main.org.java.PerformingOperationOnCorpus.main(PerformingOperationOnCorpus.java:15)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.index.CorruptIndexException
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
thanks in advance