use of org.languagetool.rules.de.GermanSpellerRule in project languagetool by languagetool-org.
the class AustrianGerman method getRelevantRules.
@Override
public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException {
List<Rule> rules = new ArrayList<>(super.getRelevantRules(messages));
rules.add(new GermanSpellerRule(messages, this));
return rules;
}
use of org.languagetool.rules.de.GermanSpellerRule in project languagetool by languagetool-org.
the class GermanyGerman method getRelevantRules.
@Override
public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException {
List<Rule> rules = new ArrayList<>(super.getRelevantRules(messages));
rules.add(new GermanSpellerRule(messages, this));
return rules;
}
use of org.languagetool.rules.de.GermanSpellerRule in project languagetool by languagetool-org.
the class SwissGerman method getRelevantRules.
@Override
public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException {
List<Rule> rules = new ArrayList<>(super.getRelevantRules(messages));
rules.add(new GermanSpellerRule(messages, this));
return rules;
}
use of org.languagetool.rules.de.GermanSpellerRule in project languagetool by languagetool-org.
the class HunspellRuleTest method testCompoundAwareRulePerformance.
@Ignore("just for internal performance testing, thus ignored by default")
@Test
public void testCompoundAwareRulePerformance() throws IOException {
ResourceBundle messages = ResourceBundle.getBundle("org.languagetool.MessagesBundle", new Locale("de"));
//slow:
//HunspellRule rule = new HunspellRule(messages, Language.GERMANY_GERMAN);
//fast:
CompoundAwareHunspellRule rule = new GermanSpellerRule(messages, new GermanyGerman());
rule.init();
String[] words = { "foo", "warmup", "Rechtschreipreform", "Theatrekasse", "Zoobesuck", "Handselvertreter", "Mückenstick", "gewönlich", "Traprennen", "Autoverkehrr" };
for (String word : words) {
long startTime = System.currentTimeMillis();
List<String> suggest = rule.getSuggestions(word);
System.out.println((System.currentTimeMillis() - startTime) + "ms for " + word + ": " + suggest);
}
}
Aggregations