use of org.languagetool.rules.ErrorTriggeringExample in project languagetool by languagetool-org.
the class PatternRuleTest method testErrorTriggeringSentences.
private void testErrorTriggeringSentences(JLanguageTool languageTool, Language lang, AbstractPatternRule rule) throws IOException {
for (ErrorTriggeringExample example : rule.getErrorTriggeringExamples()) {
String sentence = cleanXML(example.getExample());
List<RuleMatch> matches = getMatches(rule, sentence, languageTool);
if (matches.size() == 0) {
fail(lang + ": " + rule.getFullId() + ": Example sentence marked with 'triggers_error' didn't actually trigger an error: '" + sentence + "'");
}
}
}
Aggregations