@Test void testDetectHankakuKana() { Validator validator = new HankakuKanaValidator(); List<ValidationError> errors = new ArrayList<>(); validator.setErrorList(errors); validator.validate(new Sentence("岩の木陰にﾊﾅが咲いている", 0)); assertEquals(2, errors.size()); }
@Override public void validate(Sentence sentence) { Matcher matcher = pattern.matcher(sentence.getContent()); while (matcher.find()) { addLocalizedError(sentence, sentence.getContent().charAt(matcher.start())); } }
HankakuKanaValidator extends Validator { @Override public void validate(Sentence sentence) { Matcher matcher = pattern.matcher(sentence.getContent()); while (matcher.find()) { addLocalizedError(sentence, sentence.getContent().charAt(matcher.start())); } } }
HankakuKanaValidator extends Validator { @Override public void validate(Sentence sentence) { Matcher matcher = pattern.matcher(sentence.getContent()); while (matcher.find()) { addLocalizedError(sentence, sentence.getContent().charAt(matcher.start())); } } HankakuKanaValidator(); }
HankakuKanaValidator extends Validator { @Override public void validate(Sentence sentence) { Matcher matcher = pattern.matcher(sentence.getContent()); while (matcher.find()) { addLocalizedError(sentence, sentence.getContent().charAt(matcher.start())); } } HankakuKanaValidator(); @Override List<String> getSupportedLanguages(); @Override void validate(Sentence sentence); }
HankakuKanaValidator extends Validator { @Override public void validate(Sentence sentence) { Matcher matcher = pattern.matcher(sentence.getContent()); while (matcher.find()) { addLocalizedError(sentence, sentence.getContent().charAt(matcher.start())); } } HankakuKanaValidator(); @Override List<String> getSupportedLanguages(); @Override void validate(Sentence sentence);  }