From e9c805f8ed6d25e9c7ecd3a67e032fb172f7611c Mon Sep 17 00:00:00 2001 From: Corban-Lee Date: Sat, 29 Jun 2024 18:21:39 +0100 Subject: [PATCH] emoji cipher change --- src/mutators.py | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/mutators.py b/src/mutators.py index c49705d..aed8056 100644 --- a/src/mutators.py +++ b/src/mutators.py @@ -23,9 +23,9 @@ gothic_dict = { # For emoji substitution emoji_dict = { - 'a': 'đŸ…°ī¸', 'b': 'đŸ…ąī¸', 'c': '🌜', 'd': '🌛', 'e': '📧', 'f': '🎏', 'g': '🌀', 'h': '♓', 'i': 'â„šī¸', - 'j': '🎷', 'k': '🎋', 'l': 'đŸ‘ĸ', 'm': 'â“‚ī¸', 'n': '♑', 'o': 'âšŊ', 'p': 'đŸ…ŋī¸', 'q': 'đŸŗ', 'r': '🌱', - 's': '💲', 't': '🌴', 'u': '⛎', 'v': '♈', 'w': '🔱', 'x': '❎', 'y': '🍸', 'z': 'Ⓩ' + 'a': 'đŸ‡Ļ', 'b': '🇧', 'c': '🇨', 'd': '🇩', 'e': 'đŸ‡Ē', 'f': 'đŸ‡Ģ', 'g': 'đŸ‡Ŧ', 'h': '🇭', 'i': '🇮', + 'j': 'đŸ‡¯', 'k': '🇰', 'l': '🇱', 'm': '🇲', 'n': 'đŸ‡ŗ', 'o': '🇴', 'p': 'đŸ‡ĩ', 'q': 'đŸ‡ļ', 'r': '🇷', + 's': '🇸', 't': '🇹', 'u': 'đŸ‡ē', 'v': 'đŸ‡ģ', 'w': 'đŸ‡ŧ', 'x': 'đŸ‡Ŋ', 'y': '🇾', 'z': 'đŸ‡ŋ' } # For Zalgo translation @@ -41,6 +41,16 @@ morse_code_dict = { '?': '..--..', '/': '-..-.', '-': '-....-', '(': '-.--.', ')': '-.--.-', ' ': '/' } + +class Mutator: + pass + + +class SubstututionCipher(Mutator): + def apply(text: str, cipher: dict[str, str]): + return "".join(cipher.get(c.lower(), c) for c in text) + + def uwu(text: str) -> str: """ Returns an 'uwuified' version of the given string. @@ -225,9 +235,8 @@ def cat_speak(text: str) -> str: return " ".join(cat_text) def nerdify(text: str) -> str: - nerdy_phrases = ['quark', 'photon', 'nanobot', 'AI', 'quantum', 'algorithm'] - words = text.split() - return ' '.join(word + random.choice(nerdy_phrases) if random.random() < 0.3 else word for word in words) + text.replace(".", "â˜ī¸đŸ¤“.") + return text def backward_words(text: str) -> str: return ' '.join(word[::-1] for word in text.split()) @@ -295,11 +304,11 @@ mutator_map = { "VAL": valley_girl, "DEG": degeneracy, "CAT": cat_speak, - "NRD": (), - "BKW": (), - "RNG": (), - "RAS": (), - "SHK": (), - "RBT": (), - "EMI": (), + "NRD": nerdify, + "BKW": backward_words, + "RNG": lambda: None, + "RAS": lambda: None, + "SHK": lambda: None, + "RBT": lambda: None, + "EMI": lambda: None, } \ No newline at end of file