Module context

Source
Expand description

Registry of rules that define the contexts in which particular PROTOCOL-VALID characters, characters associated with a requirement for Contextual Information, are permitted. These rules are expressed as tests on the label in which the characters appear (all, or any part of, the label may be tested).
Each rule is constructed as a Boolean expression that evaluates to either true or false. A simple true or false rule sets the default result value for the rule set. Subsequent conditional rules that evaluate to true or false may re-set the result value.
A special value Undefined is used to deal with any error conditions, such as an attempt to test a character before the start of a label or after the end of a label. If any term of a rule evaluates to Undefined, further evaluation of the rule immediately terminates, as the result value of the rule will itself be Undefined.

Enums§

ContextRuleError
Error associated to the application of any context rule.

Functions§

get_context_rule
Gets the context rule associated to an Unicode code point. Arguments
rule_arabic_indic_digits
Appendix A.8. ARABIC-INDIC DIGITS
Can not be mixed with Extended Arabic-Indic Digits.
rule_extended_arabic_indic_digits
Appendix A.9. EXTENDED ARABIC-INDIC DIGITS
Can not be mixed with Arabic-Indic Digits.
rule_greek_lower_numeral_sign_keraia
Appendix A.4. GREEK LOWER NUMERAL SIGN (KERAIA)
The script of the following character MUST be Greek.
rule_hebrew_punctuation
Appendix A.5. Appendix A.6. HEBREW PUNCTUATION GERESH and HEBREW PUNCTUATION GERSHAYIM
The script of the preceding character MUST be Hebrew.
rule_katakana_middle_dot
Appendix A.7. KATAKANA MIDDLE DOT
Note that the Script of Katakana Middle Dot is not any of Hiragana, Katakana, or Han. The effect of this rule is to require at least one character in the label to be in one of those scripts.
rule_middle_dot
Appendix A.3. MIDDLE DOT
Between ‘l’ U+006C characters only, used to permit the Catalan character ela geminada to be expressed.
rule_zero_width_joiner
Appendix A.2. ZERO WIDTH JOINER
This may occur in Indic scripts in a consonant-conjunct context (immediately following a virama), to control required display of such conjuncts.
rule_zero_width_nonjoiner
Appendix A.1. ZERO WIDTH NON-JOINER U+200C This may occur in a formally cursive script (such as Arabic) in a context where it breaks a cursive connection as required for orthographic rules, as in the Persian language, for example. It also may occur in Indic scripts in a consonant-conjunct context (immediately following a virama), to control required display of such conjuncts.

Type Aliases§

ContextRule
Describes a context rule function