@Test void testWithoutInvalidSymbol() throws RedPenException { List<Document> documents = new ArrayList<>(); documents.add( Document.builder() .addSection(1) .addParagraph() .addSentence(new Sentence("I like Karaoke", 1)) .build()); Configuration conf = Configuration.builder() .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol")) .addSymbol(new Symbol(EXCLAMATION_MARK, '!', "！")) .build(); RedPen redPen = new RedPen(conf); Map<Document, List<ValidationError>> errors = redPen.validate(documents); assertEquals(0, errors.get(documents.get(0)).size()); }
@Override public void validate(Sentence sentence) { Set<SymbolType> symbolTypes = getSymbolTable().getNames(); for (SymbolType symbolType : symbolTypes) { validateSymbol(sentence, symbolType); } }
InvalidSymbolValidator extends Validator { @Override public void validate(Sentence sentence) { Set<SymbolType> symbolTypes = getSymbolTable().getNames(); for (SymbolType symbolType : symbolTypes) { validateSymbol(sentence, symbolType); } } }
InvalidSymbolValidator extends Validator { @Override public void validate(Sentence sentence) { Set<SymbolType> symbolTypes = getSymbolTable().getNames(); for (SymbolType symbolType : symbolTypes) { validateSymbol(sentence, symbolType); } }  }
InvalidSymbolValidator extends Validator { @Override public void validate(Sentence sentence) { Set<SymbolType> symbolTypes = getSymbolTable().getNames(); for (SymbolType symbolType : symbolTypes) { validateSymbol(sentence, symbolType); } }  @Override void validate(Sentence sentence); }
InvalidSymbolValidator extends Validator { @Override public void validate(Sentence sentence) { Set<SymbolType> symbolTypes = getSymbolTable().getNames(); for (SymbolType symbolType : symbolTypes) { validateSymbol(sentence, symbolType); } }  @Override void validate(Sentence sentence);  }