0

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

Sara
  • 57
  • 1
  • 2
  • 11
  • This library looks outdated. However, the [documentation](http://tml-java.sourceforge.net/) sayes: _To use TML from another java program you have to include TML in your classpath. You can use the provided tml-xxx-core.jar that does not include dependencies to avoid conflicting jars and save disk space._ This means you have to add all required libraries used in **tml** to your project manually. I think you should for an alternative with active support. – Michael Rhöse May 18 '17 at 10:13
  • thank you for your answer , any suggestion to implement LSA then – Sara May 19 '17 at 09:26
  • The only library i know which looks activ and useful is [S-Space](https://github.com/fozziethebeat/S-Space). Hope that helps. – Michael Rhöse May 19 '17 at 12:09

0 Answers0