Interface PhraseEntry

One entry of a list: the phrase, how it matches, and what a match does (a block at once, or the judge's read).

interface PhraseEntry {
    phrase: string;
    match: "regex" | "word" | "substring";
    onMatch: "block" | "judge";
    ruleId?: string;
}

Properties

phrase: string
match: "regex" | "word" | "substring"

word: the phrase between word boundaries; substring: anywhere; regex: the phrase is a regular expression. Every entry runs over the normalised text (lower case, marks and zero-width characters removed, look-alike letters mapped to Latin, quotes straightened): a word or substring phrase is normalised the same way before it is compiled, while a regex source is compiled as written, so write a regex in that normalised form.

onMatch: "block" | "judge"

block: a match blocks; judge: the judge decides whether the match, in context, crosses the rule.

ruleId?: string

The rule the entry belongs to: the block's reasonCode and the key of its replacement.