Skip to content

Substitute

POLITE_WORD_MAP = {'רע$': 'ער', 'רעב$': 'ערב', '^רעה$': 'ערה', 'רצח$': 'רחצ', '^שד$': 'דש', 'שמד$': 'שדמ'} module-attribute ל

Map of "impolite" words, and their polite equivalents.

Substitutions ל

Constants containing sets of functions for use in substitution_functions.

Source code in hebrew/numerical_conversion/substitute.py
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class Substitutions:
    """
    Constants containing sets of functions for use in substitution_functions.
    """

    DEFAULT = _BASIC_FUNCTIONS
    "The default set of substitutions; 'טו' and 'טז'"

    ALL = (
        tuple(_get_word_substitution_func(w[0], w[1]) for w in POLITE_WORD_MAP.items())
        + _BASIC_FUNCTIONS
    )

    "All available substitution functions. See `POLITE_WORD_MAP` and `DEFAULT`; 'טו' and 'טז'"

ALL = tuple(_get_word_substitution_func(w[0], w[1]) for w in POLITE_WORD_MAP.items()) + _BASIC_FUNCTIONS class-attribute instance-attribute ל

All available substitution functions. See POLITE_WORD_MAP and DEFAULT; 'טו' and 'טז'

DEFAULT = _BASIC_FUNCTIONS class-attribute instance-attribute ל

The default set of substitutions; 'טו' and 'טז'

yud_hey_to_tes_vav(value) ל

Used to substitute 'יה' for 'טו' in a string

Source code in hebrew/numerical_conversion/substitute.py
5
6
7
def yud_hey_to_tes_vav(value: str) -> str:
    """Used to substitute 'יה' for 'טו' in a string"""
    return re.sub(r"יה$", "טו", value)

yud_vav_to_tes_zayen(value) ל

Used to substitute 'יו' for 'טז' in a string

Source code in hebrew/numerical_conversion/substitute.py
10
11
12
def yud_vav_to_tes_zayen(value: str) -> str:
    """Used to substitute 'יו' for 'טז' in a string"""
    return re.sub(r"יו$", "טז", value)