Closed GoogleCodeExporter closed 9 years ago
That's an error, indeed. Here's a quick fix for version 1.0.0:
{{{
IWiktionaryEdition wkt = JWKTL.openEdition(WIKTIONARY_DIRECTORY);
WiktionaryEntryFilter filter = new WiktionaryEntryFilter(){
@Override
protected boolean acceptWordLanguage(final IWiktionaryEntry entry) {
if (entry.getWordLanguage() == null)
return false;
return super.acceptWordLanguage(entry);
}
@Override
protected boolean acceptPartOfSpeech(final IWiktionaryEntry entry) {
if (entry.getPartOfSpeech() == null)
return false;
return super.acceptPartOfSpeech(entry);
}
};
filter.setAllowedWordLanguages(Language.GERMAN);
filter.setAllowedPartsOfSpeech(PartOfSpeech.ADJECTIVE);
int deAdjectiveCount = 0;
for (IWiktionaryEntry entry : wkt.getAllEntries(filter)) {
System.out.println(entry.getWord());
deAdjectiveCount++;
}
System.out.println("German adjectives: " + deAdjectiveCount);
wkt.close();
}}}
Proper fix is available for the current head revision.
Original comment by chmeyer.de
on 21 Aug 2013 at 3:20
Possible hint is that some entries contain no information about the word
language,
that is to say, "entry.getWordLanguage().equals(null)" and this leads to an
exception when trying to filter.
Original comment by abdoulay...@neofonie.de
on 21 Aug 2013 at 3:21
Thx for the quick reply.
Checking out the fix will also be great, but it seems that one dependency
cannot be found, when I try to build the artifact using 'mvn install'. This
concerns the following one:
xerces:xercesImpl:jar:2.9.1-lucene
Missing:
----------
1) xerces:xercesImpl:jar:2.9.1-lucene
Try downloading the file manually from the project website.
Original comment by abdoulay...@neofonie.de
on 21 Aug 2013 at 3:25
Could you please open separate issues for different problems? Xerces should
come directly via Maven or is available from
http://xerces.apache.org/xerces2-j/.
Original comment by chmeyer.de
on 21 Aug 2013 at 3:34
Original comment by chmeyer.de
on 21 Aug 2013 at 3:38
[deleted comment]
Oh soory I missed that. I will open separate issues for different problems from
now on.
Original comment by abdoulay...@neofonie.de
on 21 Aug 2013 at 3:40
Original issue reported on code.google.com by
abdoulay...@neofonie.de
on 21 Aug 2013 at 3:06