assertEquals(1, matches2.size());
assertEquals("MORFOLOGIK_RULE_EN_US", matches2.get(0).getRule().getId());
}
public void testIgnoreSuggestionsWithDynamicMorfologikRule() throws IOException {
final JLanguageTool langTool = new JLanguageTool(new AmericanEnglish());
final SpellingCheckRule rule = new MorfologikAmericanSpellerRule(TestTools.getEnglishMessages(), new AmericanEnglish());
langTool.addRule(rule);
final List<RuleMatch> matches = langTool.check("This is a typoh.");
assertEquals(1, matches.size());
assertEquals(MorfologikAmericanSpellerRule.RULE_ID, matches.get(0).getRule().getId());
final PatternRule ruleWithSuggestion = new PatternRule("TEST_ID", new AmericanEnglish(),
Collections.<Element>emptyList(), "description",
"Did you mean <suggestion>typoh</suggestion>?", null);
langTool.addRule(ruleWithSuggestion);
final List<RuleMatch> matches2 = langTool.check("This is a typoh.");
assertEquals(0, matches2.size()); // no error anymore, as this is a suggestion