Package org.languagetool.rules.de

Examples of org.languagetool.rules.de.GermanSpellerRule$Replacement


  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


  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

  }

  @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

  }

  @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

  }

  @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

Related Classes of org.languagetool.rules.de.GermanSpellerRule$Replacement

Copyright © 2018 www.massapicom. 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.