Examples of GermanSpellerRule


Examples of org.languagetool.rules.de.GermanSpellerRule

  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);
    }
  }
View Full Code Here

Examples of org.languagetool.rules.de.GermanSpellerRule

  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);
    }
  }
View Full Code Here

Examples of org.languagetool.rules.de.GermanSpellerRule

  }

  @Override
  public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException {
    final List<Rule> rules = new ArrayList<>(super.getRelevantRules(messages));
    rules.add(new GermanSpellerRule(messages, this));
    return rules;
  }
View Full Code Here

Examples of org.languagetool.rules.de.GermanSpellerRule

  }

  @Override
  public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException {
    final List<Rule> rules = new ArrayList<>(super.getRelevantRules(messages));
    rules.add(new GermanSpellerRule(messages, this));
    return rules;
  }
View Full Code Here

Examples of org.languagetool.rules.de.GermanSpellerRule

  }

  @Override
  public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException {
    final List<Rule> rules = new ArrayList<>(super.getRelevantRules(messages));
    rules.add(new GermanSpellerRule(messages, this));
    return rules;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.