use of org.languagetool.tagging.Tagger in project languagetool by languagetool-org.
the class GermanTaggerEnhancer method run.
private void run() throws IOException {
final Dictionary dictionary = Dictionary.read(JLanguageTool.getDataBroker().getFromResourceDirAsUrl("/de/german.dict"));
final DictionaryLookup dl = new DictionaryLookup(dictionary);
Tagger tagger = new German().getTagger();
String prev = null;
for (WordData wd : dl) {
String word = wd.getWord().toString();
if (word.endsWith("er") && StringTools.startsWithUppercase(word)) {
if (!hasAdjReading(tagger, word) && isEigenname(tagger, word.substring(0, word.length() - 2)) && !word.equals(prev)) {
for (String newTags : ADJ_READINGS) {
System.out.println(word + "\t" + word + "\t" + newTags + ":DEF");
System.out.println(word + "\t" + word + "\t" + newTags + ":IND");
System.out.println(word + "\t" + word + "\t" + newTags + ":SOL");
}
prev = word;
}
}
}
}
Aggregations