@Test void testNeedSpaceInMultiplePosition() throws RedPenException { Document document = prepareSimpleDocument("I like her(Nancy)very much."); config = Configuration.builder() .addValidatorConfig(new ValidatorConfiguration("SymbolWithSpace")) .addSymbol(new Symbol(LEFT_PARENTHESIS, '(', "", true, false)) .addSymbol(new Symbol(RIGHT_PARENTHESIS, ')', "", false, true)) .build(); RedPen redPen = new RedPen(config); Map<Document, List<ValidationError>> errors = redPen.validate(singletonList(document)); assertEquals(2, errors.get(document).size()); assertEquals(asList("Need whitespace after symbol \")\".", "Need whitespace before symbol \"(\"."), errors.get(document).stream().map(ValidationError::getMessage).sorted().collect(toList())); }
@Override public void validate(Sentence sentence) { Set<SymbolType> symbolTypes = getSymbolTable().getNames(); for (SymbolType symbolType : symbolTypes) { validateSymbol(sentence, symbolType); } }
SymbolWithSpaceValidator extends Validator { @Override public void validate(Sentence sentence) { Set<SymbolType> symbolTypes = getSymbolTable().getNames(); for (SymbolType symbolType : symbolTypes) { validateSymbol(sentence, symbolType); } } }
SymbolWithSpaceValidator extends Validator { @Override public void validate(Sentence sentence) { Set<SymbolType> symbolTypes = getSymbolTable().getNames(); for (SymbolType symbolType : symbolTypes) { validateSymbol(sentence, symbolType); } }  }
SymbolWithSpaceValidator 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); }
SymbolWithSpaceValidator 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);  }