@Test void testErrorAfterPosition() throws RedPenException { String sampleText = "I like her (Nancy)very much."; Configuration configuration = Configuration.builder() .addValidatorConfig(new ValidatorConfiguration("SymbolWithSpace")) .build(); DocumentParser parser = DocumentParser.MARKDOWN; List<Document> documents = new ArrayList<>(); Document document = parser.parse( sampleText, new SentenceExtractor(configuration.getSymbolTable()), configuration.getTokenizer()); documents.add(document); RedPen redPen = new RedPen(configuration); List<ValidationError> errors = redPen.validate(documents).get(documents.get(0)); assertEquals(1, errors.size()); assertEquals("SymbolWithSpace", errors.get(0).getValidatorName()); assertEquals(new LineOffset(1, 17), errors.get(0).getStartPosition().get()); assertEquals(new LineOffset(1, 18), errors.get(0).getEndPosition().get()); }
@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);  }