From 4eea9db46cc9d2dab599466b0a0a1fe5a0baa0be Mon Sep 17 00:00:00 2001 From: Ivan Charapanau Date: Mon, 23 Sep 2024 20:51:25 +0200 Subject: [PATCH] feat: invert_180 for klmbr --- boost/src/modules/klmbr.py | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/boost/src/modules/klmbr.py b/boost/src/modules/klmbr.py index a61e113..681071b 100644 --- a/boost/src/modules/klmbr.py +++ b/boost/src/modules/klmbr.py @@ -26,6 +26,59 @@ "l": "1", } +invert_map = { + 'a': 'ɐ', + 'b': 'q', + 'c': 'ɔ', + 'd': 'p', + 'e': 'ǝ', + 'f': 'ɟ', + 'g': 'ƃ', + 'h': 'ɥ', + 'i': 'ᴉ', + 'j': 'ɾ', + 'k': 'ʞ', + 'l': 'l', + 'n': 'u', + 'o': 'o', + 'p': 'd', + 'q': 'b', + 'r': 'ɹ', + 's': 's', + 't': 'ʇ', + 'u': 'n', + 'v': 'ʌ', + 'w': 'ʍ', + 'x': 'x', + 'y': 'ʎ', + 'z': 'z', + 'A': '∀', + 'B': '𐐒', + 'C': 'Ɔ', + 'D': 'ᗡ', + 'E': 'Ǝ', + 'F': 'Ⅎ', + 'G': '⅁', + 'H': 'H', + 'I': 'I', + 'K': '⋊', + 'L': '˥', + 'M': 'W', + 'N': 'N', + 'O': 'O', + 'P': 'Ԁ', + 'Q': 'Q', + 'R': 'ᴚ', + 'S': 'S', + 'T': '⊥', + 'U': '∩', + 'V': 'Λ', + 'W': 'M', + 'X': 'X', + 'Y': '⅄', + 'Z': 'Z', +} + diacritics = ["̀", "́", "̂", "̃", "̈", "̄", "̆", "̇", "̊", "̋"] punctuation = ".,!?;:" @@ -51,11 +104,16 @@ def remove_vowel(chars, idx): return chars[idx] +def invert_180(chars, idx): + return invert_map.get(chars[idx], chars[idx]) + + mods = { "capitalize": capitalize, "diacritic": diacritic, "leetspeak": leetspeak, "remove_vowel": remove_vowel, + "invert_180": invert_180, }