disableRules();
if (indexTopDir != null) {
if (indexTopDir.isDirectory()) {
languageModel = new LuceneLanguageModel(indexTopDir);
System.out.println("Using Lucene language model from " + languageModel);
EnglishConfusionProbabilityRule probabilityRule =
new EnglishConfusionProbabilityRule(JLanguageTool.getMessageBundle(), languageModel, new English());
//new EnglishConfusionProbabilityRule(JLanguageTool.getMessageBundle(), languageModel, new File("/tmp/languagetool_network.net"));
langTool.addRule(probabilityRule);
} else {
throw new RuntimeException("Does not exist or not a directory: " + indexTopDir);
}