Package org.languagetool.languagemodel

Examples of org.languagetool.languagemodel.LanguageModel


    doc.add(countField);
    writer.addDocument(doc);
  }

  private void testIndex(File languageModelIndex) throws IOException {
    LanguageModel languageModel = new LuceneLanguageModel(languageModelIndex);
    ConfusionProbabilityRule rule = new ConfusionProbabilityRule(TestTools.getEnglishMessages(), languageModel, new FakeLanguage()) {
      @Override public String getDescription() { return null; }
      @Override public String getMessage(String suggestion) { return null; }
    };
    ConfusionProbabilityRule.ConfusionSet confusionSet = new ConfusionProbabilityRule.ConfusionSet("a", "an");
View Full Code Here


   * consists of Lucene indexes with ngram occurrence counts.
   * @param indexDir directory with a '3grams' sub directory which contains a Lucene index with 3gram occurrence counts
   * @since 2.7
   */
  public void activateLanguageModelRules(File indexDir) throws IOException {
    LanguageModel languageModel = language.getLanguageModel(indexDir);
    if (languageModel != null) {
      ResourceBundle messages = getMessageBundle(language);
      List<Rule> rules = language.getRelevantLanguageModelRules(messages, languageModel);
      userRules.addAll(rules);
    }
View Full Code Here

TOP

Related Classes of org.languagetool.languagemodel.LanguageModel

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.