public final class SentenceLengthValidator extends Validator
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_LENGTH
Default maximum length of sentences.
|
KEY_VALUE, RULE, WORD_LIST, WORD_LIST_LOWERCASED
Constructor and Description |
---|
SentenceLengthValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
protected void |
init()
Validation initialization, called after the configuration and symbol tables have been assigned
|
protected void |
setLengthLimit(int maxLength)
Set maximum length of sentence.
|
protected void |
setMaxLength(int max) |
String |
toString() |
void |
validate(Sentence sentence)
validate the input document and returns the invalid points.
|
addError, addErrorWithPosition, addLocalizedError, addLocalizedError, addLocalizedErrorFromToken, addLocalizedErrorWithPosition, addLocalizedErrorWithPosition, addValidationError, addValidationError, addValidationErrorFromToken, addValidationErrorWithPosition, addValidationErrorWithPosition, getConfigAttribute, getConfigAttribute, getConfigAttributeAsBoolean, getConfigAttributeAsDouble, getConfigAttributeAsInt, getConfigAttributes, getLocalizedErrorMessage, getSupportedLanguages, getSymbolTable, preValidate, preValidate, setErrorList, validate, validate
public static final int DEFAULT_MAX_LENGTH
public void validate(Sentence sentence)
Validator
Validator
provides empty implementation. Validator implementation validates sentences can override this method.protected void init() throws RedPenException
Validator
init
in class Validator
RedPenException
protected void setLengthLimit(int maxLength)
maxLength
- max limit of sentence lengthprotected void setMaxLength(int max)
Copyright © 2015. All rights reserved.