Closed chmeyer 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.
Reported by chmeyer.de
on 2013-08-21 15:20:45
Fixed
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.
Reported by abdoulaye.drame@neofonie.de
on 2013-08-21 15:21:06
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.
Reported by abdoulaye.drame@neofonie.de
on 2013-08-21 15:25:29
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/.
Reported by chmeyer.de
on 2013-08-21 15:34:27
Reported by chmeyer.de
on 2013-08-21 15:38:26
Oh soory I missed that. I will open separate issues for different problems from now
on.
Reported by abdoulaye.drame@neofonie.de
on 2013-08-21 15:40:46
Originally reported on Google Code with ID 1
Reported by
abdoulaye.drame@neofonie.de
on 2013-08-21 15:06:15