private int globalSentenceCount;
private int globalRuleMatches;
RealWordFalseAlarmEvaluator(File languageModelIndexDir) throws IOException {
InputStream inputStream = JLanguageTool.getDataBroker().getFromResourceDirAsStream("/en/homophones.txt");
ConfusionSetLoader confusionSetLoader;
if (EVAL_MODE) {
InputStream infoStream = JLanguageTool.getDataBroker().getFromResourceDirAsStream("/en/homophones-info.txt");
confusionSetLoader = new ConfusionSetLoader(infoStream, MIN_SENTENCES, MAX_ERROR_RATE);
} else {
confusionSetLoader = new ConfusionSetLoader();
}
confusionSet = confusionSetLoader.loadConfusionSet(inputStream);
langTool = new JLanguageTool(new BritishEnglish());
//langTool.activateDefaultPatternRules();
List<Rule> rules = langTool.getAllActiveRules();
for (Rule rule : rules) {
langTool.disableRule(rule.getId());