This repository has been archived on 2021-08-24. You can view files and clone it, but cannot push or open issues or pull requests.
cutthecord/patches/slashcommands/textreplacegen-array.py

152 lines
2.4 KiB
Python
Raw Normal View History

smol = {
2019-05-21 16:36:08 +00:00
"a": "",
"b": "ʙ",
"c": "",
"d": "",
"e": "",
"f": "",
"g": "ɢ",
"h": "ʜ",
"i": "ɪ",
"j": "",
"k": "",
"l": "ʟ",
"m": "",
"n": "ɴ",
"o": "",
"p": "",
"q": "ǫ",
"r": "ʀ",
"s": "s",
"t": "",
"u": "",
"v": "",
"w": "",
"x": "x",
"y": "ʏ",
"z": ""
}
smoller = {
2019-05-21 16:36:08 +00:00
"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": ""
}
flipped = {
2019-05-21 16:36:08 +00:00
"a": "ɐ",
"b": "q",
"c": "ɔ",
"d": "p",
"e": "ǝ",
"f": "ɟ",
"g": "ƃ",
"h": "ɥ",
"i": "ı",
"j": "ɾ",
"k": "ʞ",
"l": "ן",
"m": "ɯ",
"n": "u",
"o": "o",
"p": "d",
"q": "b",
"r": "ɹ",
"s": "s",
"t": "ʇ",
"u": "n",
"v": "ʌ",
"w": "ʍ",
"x": "x",
"y": "ʎ",
"z": "z"
}
morse = {
" ": "/ ",
".": ".-.-.- ",
",": "--..-- ",
":": "---... ",
"?": "..--.. ",
"'": ".----. ",
"-": "-....- ",
"/": "-..-. ",
"@": ".--.-. ",
"=": "-...- ",
"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": "--.. ",
"0": "----- ",
"1": ".---- ",
"2": "..--- ",
"3": "...-- ",
"4": "....- ",
"5": "..... ",
"6": "-.... ",
"7": "--... ",
"8": "---.. ",
"9": "----. "
}
code = """
const-string v0, "before"
const-string v1, "after"
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object p0"""
2019-05-21 16:36:08 +00:00
fw = morse
for entry in fw:
if entry in ["\\", "\""]:
continue
print(code.replace("before", entry).replace("after", fw[entry]))