This validator checks a set of rules writers should adherre. The rules are written in the YAML format.
In the rule file there are three block lang, name and pattern. Users specify target languages, and the name of the validator in lang and name blocks respectivly. In patterns block, users add the specific rules as pattern block. pattern block has block token or exp.
- lang: en
- name: redundant-expression-en
- patterns:
- pattern:
- toekn: is
- token: considered
- pattern:
- token: it
- token: is
- token: *
- token: that
- pattern:
- token: as
- token: *
- gap:
- min: 1
- max: 100
- token: as
- token: well
- lang: en
- name: redundant-expression-en
- patterns:
- pattern:
- toekn: *
- exceptions:
- token: is
- token: are
- token:
- label[1]: V
- token: considered
- lang: ja
- name: redundant-expression-ja
- pattern:
- pattern:
- regex: (する|した)ことが可能
- pattern: だと考えられる
- pattern:
- token: で
- token:
- regex: あ(る|った)
- label[1]: 助動詞
- token: *
- optional: true
- token: かも
- label[1]: 副詞
RuleValidator contains a set of default rules for each language. When users want to suppress the validation with the specific rules, specify the rules in "remove" property. Add add property when users want to self defined rules (the rules are stored in $REDPEN_HOME/rule directory).
<redpen-conf lang="en">
<validators>
<validator name="Rule">
<property name="suppress" value="redundant,tense"/>
<property name="path" value="./" />
</validator>
</validators>
</redpen-conf>
- suppress: suppress the specified rules
- path: load user defined rules from the specified path