@Test void testValid() throws RedPenException { Configuration config = Configuration.builder("ja") .addValidatorConfig(new ValidatorConfiguration("JapaneseAnchorExpression")) .build(); List<Document> documents = new ArrayList<>();documents.add( Document.builder(new NeologdJapaneseTokenizer()) .addSection(1) .addParagraph() .addSentence(new Sentence("1章を参照されたい。", 1)) .build()); RedPen redPen = new RedPen(config); List<ValidationError> errors = redPen.validate(documents).get(documents.get(0)); assertEquals(0, errors.size()); }
@Override public void validate(Sentence sentence) { for (Pattern pat : patternsOfCurrentMode()) { final Matcher m = pat.matcher(sentence.getContent()); while (m.find()) { addLocalizedError(sentence, m.group(0)); } } }
JapaneseAnchorExpressionValidator extends Validator { @Override public void validate(Sentence sentence) { for (Pattern pat : patternsOfCurrentMode()) { final Matcher m = pat.matcher(sentence.getContent()); while (m.find()) { addLocalizedError(sentence, m.group(0)); } } } }
JapaneseAnchorExpressionValidator extends Validator { @Override public void validate(Sentence sentence) { for (Pattern pat : patternsOfCurrentMode()) { final Matcher m = pat.matcher(sentence.getContent()); while (m.find()) { addLocalizedError(sentence, m.group(0)); } } } JapaneseAnchorExpressionValidator(); }
JapaneseAnchorExpressionValidator extends Validator { @Override public void validate(Sentence sentence) { for (Pattern pat : patternsOfCurrentMode()) { final Matcher m = pat.matcher(sentence.getContent()); while (m.find()) { addLocalizedError(sentence, m.group(0)); } } } JapaneseAnchorExpressionValidator(); @Override List<String> getSupportedLanguages(); @Override void validate(Sentence sentence); }
JapaneseAnchorExpressionValidator extends Validator { @Override public void validate(Sentence sentence) { for (Pattern pat : patternsOfCurrentMode()) { final Matcher m = pat.matcher(sentence.getContent()); while (m.find()) { addLocalizedError(sentence, m.group(0)); } } } JapaneseAnchorExpressionValidator(); @Override List<String> getSupportedLanguages(); @Override void validate(Sentence sentence);  }