langTool = new JLanguageTool(new BritishEnglish());
langTool.activateDefaultPatternRules();
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);