public void testCompoundAwareRulePerformance() throws IOException {
final ResourceBundle messages = ResourceBundle.getBundle("org.languagetool.MessagesBundle", new Locale("de"));
//slow:
//final HunspellRule rule = new HunspellRule(messages, Language.GERMANY_GERMAN);
//fast:
final CompoundAwareHunspellRule rule = new GermanSpellerRule(messages, new GermanyGerman());
rule.init();
final String[] words = {"foo", "warmup", "Rechtschreipreform", "Theatrekasse", "Zoobesuck", "Handselvertreter", "Mückenstick", "gewönlich", "Traprennen", "Autoverkehrr"};
for (String word : words) {
final long startTime = System.currentTimeMillis();
final List<String> suggest = rule.getSuggestions(word);
System.out.println((System.currentTimeMillis()-startTime) + "ms for " + word + ": " + suggest);
}
}