有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

JAVAlang.NoClassDefFoundError:org/apache/lucene/index/corruptindexception

我尝试使用TML库实现LSA语义搜索。这是我的代码,其中rep1是我创建的文件夹,dossier是我放置txt文档的文件夹

  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();


    }

但我有这个错误

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)

提前谢谢


共 (0) 个答案