Thesaurus lexicon (University of Leipzig, Germany) Sample

Thesaurus lexicon (University of Leipzig, Germany) Homepage.

// create a special ServiceManager (with URL and Serializer/Deserializer configuration
IServiceManager manager = new WortschatzServiceManager();

// simple ping to test the connection
Thesaurus thesaurus = (Thesaurus) manager.createService(Thesaurus.class);
System.out.println("PING: " + thesaurus.ping());

// thesaurus request for the german word leer, with max 5 response word
List lvResultList = thesaurus.execute("leer", 5).getResultList();
System.out.println("- Thesaurus -");
System.out.println(lvResultList); 

Similarity similarity = (Similarity) manager.createService(Similarity.class);
System.out.println("- Similarity -");
System.out.println(similarity.execute("leer", 2).getResultList());

Wordforms wordform= (Wordforms) manager.createService(Wordforms.class);
System.out.println("- Wordforms -");
System.out.println(wordform.execute("leer" ,2).getResultList());

Sentences sentences = (Sentences) manager.createService(Sentences.class);
System.out.println("- Sentences -");
System.out.println(sentences.execute("leer", 2).getResultList());

Frequencies frequencies = (Frequencies) manager.createService(Frequencies.class);
System.out.println("- Frequencies -");
System.out.println(frequencies.execute("leer").getResultList());

Synonyms synonyms = (Synonyms) manager.createService(Synonyms.class);
System.out.println("- Synonyms -");
System.out.println(synonyms.execute("leer", 2).getResultList());