@Test void testLoadSkipList() throws Exception { List<Document> documents = new ArrayList<>();documents.add( Document.builder() .addSection(1) .addParagraph() .addSentence(new Sentence("The output is JSON format.", 1)) .build()); Configuration config = Configuration.builder() .addValidatorConfig(new ValidatorConfiguration("UnexpandedAcronym").addProperty("list", "JSON")) .build(); RedPen redPen = new RedPen(config); Map<Document, List<ValidationError>> errors = redPen.validate(documents); assertEquals(0, errors.get(documents.get(0)).size()); }
@Override public void validate(Document document) { for (String acronym : contractedAcronyms.keySet()) { if (!expandedAcronyms.contains(acronym)) { addLocalizedError("UnexpandedAcronym", contractedAcronyms.get(acronym), acronym); } } }
UnexpandedAcronymValidator extends SpellingDictionaryValidator { @Override public void validate(Document document) { for (String acronym : contractedAcronyms.keySet()) { if (!expandedAcronyms.contains(acronym)) { addLocalizedError("UnexpandedAcronym", contractedAcronyms.get(acronym), acronym); } } } }
UnexpandedAcronymValidator extends SpellingDictionaryValidator { @Override public void validate(Document document) { for (String acronym : contractedAcronyms.keySet()) { if (!expandedAcronyms.contains(acronym)) { addLocalizedError("UnexpandedAcronym", contractedAcronyms.get(acronym), acronym); } } } UnexpandedAcronymValidator(); }
UnexpandedAcronymValidator extends SpellingDictionaryValidator { @Override public void validate(Document document) { for (String acronym : contractedAcronyms.keySet()) { if (!expandedAcronyms.contains(acronym)) { addLocalizedError("UnexpandedAcronym", contractedAcronyms.get(acronym), acronym); } } } UnexpandedAcronymValidator(); @Override List<String> getSupportedLanguages(); @Override void validate(Document document); @Override void preValidate(Document document); }
UnexpandedAcronymValidator extends SpellingDictionaryValidator { @Override public void validate(Document document) { for (String acronym : contractedAcronyms.keySet()) { if (!expandedAcronyms.contains(acronym)) { addLocalizedError("UnexpandedAcronym", contractedAcronyms.get(acronym), acronym); } } } UnexpandedAcronymValidator(); @Override List<String> getSupportedLanguages(); @Override void validate(Document document); @Override void preValidate(Document document);  }