private void setUpRule(Language language) throws IOException {
   langTool = new JLanguageTool(language);
   for (Rule rule : langTool.getAllRules()) {
     langTool.disableRule(rule.getId());
   }
   GenericUnpairedBracketsRule rule =
       new GenericUnpairedBracketsRule(TestTools.getEnglishMessages(), language);
   langTool.addRule(rule);
 }
Exemple #2
0
 private JLanguageTool getLanguageToolWithOneRule(Language lang, PatternRule patternRule)
     throws IOException {
   final JLanguageTool langTool = new JLanguageTool(lang);
   for (Rule rule : langTool.getAllActiveRules()) {
     langTool.disableRule(rule.getId());
   }
   langTool.addRule(patternRule);
   return langTool;
 }