@Test void testDoubledSkipListWord() throws RedPenException { Document document = prepareSimpleDocument("That is true, as far as I know."); RedPen redPen = new RedPen(config); Map<Document, List<ValidationError>> errors = redPen.validate(singletonList(document)); assertEquals(0, errors.get(document).size()); }
@Override public void validate(Sentence sentence) { Set<String> surfaces = new HashSet<>(); for (TokenElement token : sentence.getTokens()) { String word = token.getSurface().toLowerCase(); if (word.length() >= getInt("min_len") && surfaces.contains(word) && !inDictionary(word)) { addLocalizedErrorFromToken(sentence, token); } surfaces.add(word); } }
DoubledWordValidator extends DictionaryValidator { @Override public void validate(Sentence sentence) { Set<String> surfaces = new HashSet<>(); for (TokenElement token : sentence.getTokens()) { String word = token.getSurface().toLowerCase(); if (word.length() >= getInt("min_len") && surfaces.contains(word) && !inDictionary(word)) { addLocalizedErrorFromToken(sentence, token); } surfaces.add(word); } } }
DoubledWordValidator extends DictionaryValidator { @Override public void validate(Sentence sentence) { Set<String> surfaces = new HashSet<>(); for (TokenElement token : sentence.getTokens()) { String word = token.getSurface().toLowerCase(); if (word.length() >= getInt("min_len") && surfaces.contains(word) && !inDictionary(word)) { addLocalizedErrorFromToken(sentence, token); } surfaces.add(word); } } DoubledWordValidator(); }
DoubledWordValidator extends DictionaryValidator { @Override public void validate(Sentence sentence) { Set<String> surfaces = new HashSet<>(); for (TokenElement token : sentence.getTokens()) { String word = token.getSurface().toLowerCase(); if (word.length() >= getInt("min_len") && surfaces.contains(word) && !inDictionary(word)) { addLocalizedErrorFromToken(sentence, token); } surfaces.add(word); } } DoubledWordValidator(); @Override void validate(Sentence sentence); }
DoubledWordValidator extends DictionaryValidator { @Override public void validate(Sentence sentence) { Set<String> surfaces = new HashSet<>(); for (TokenElement token : sentence.getTokens()) { String word = token.getSurface().toLowerCase(); if (word.length() >= getInt("min_len") && surfaces.contains(word) && !inDictionary(word)) { addLocalizedErrorFromToken(sentence, token); } surfaces.add(word); } } DoubledWordValidator(); @Override void validate(Sentence sentence);  }