@Test void testDoubleQuotationMakrs() throws RedPenException { Validator validator = ValidatorFactory.getInstance("Quotation"); Sentence str = new Sentence("I said “That is true”.", 0); List<ValidationError> errors = new ArrayList<>(); validator.setErrorList(errors); validator.validate(str); assertNotNull(errors); assertEquals(0, errors.size()); }
@Override public void validate(Sentence sentence) { checkQuotation(sentence, leftSingleQuotationMark, rightSingleQuotationMark); checkQuotation(sentence, leftDoubleQuotationMark, rightDoubleQuotationMark); }
QuotationValidator extends Validator { @Override public void validate(Sentence sentence) { checkQuotation(sentence, leftSingleQuotationMark, rightSingleQuotationMark); checkQuotation(sentence, leftDoubleQuotationMark, rightDoubleQuotationMark); } }
QuotationValidator extends Validator { @Override public void validate(Sentence sentence) { checkQuotation(sentence, leftSingleQuotationMark, rightSingleQuotationMark); checkQuotation(sentence, leftDoubleQuotationMark, rightDoubleQuotationMark); } QuotationValidator(); }
QuotationValidator extends Validator { @Override public void validate(Sentence sentence) { checkQuotation(sentence, leftSingleQuotationMark, rightSingleQuotationMark); checkQuotation(sentence, leftDoubleQuotationMark, rightDoubleQuotationMark); } QuotationValidator(); @Override List<String> getSupportedLanguages(); @Override void validate(Sentence sentence); }
QuotationValidator extends Validator { @Override public void validate(Sentence sentence) { checkQuotation(sentence, leftSingleQuotationMark, rightSingleQuotationMark); checkQuotation(sentence, leftDoubleQuotationMark, rightDoubleQuotationMark); } QuotationValidator(); @Override List<String> getSupportedLanguages(); @Override void validate(Sentence sentence);  }