Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed translation for x and other fixes #2

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ This script was originally made for [NotEssential](https://notessential.blurry.g

- Forces characters into all UPPERCASE/lowercase
- Flips text upside down.
- Translates to the Standard Galactic Alphabet
...and more coming soon (maybe)!
27 changes: 14 additions & 13 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,32 @@ def flipUD(text):
"ɐqɔpǝɟƃɥᴉſʞʅɯuodbɹsʇnʌʍxʎz∀𐐒ƆᗡƎℲ⅁HIſʞ⅃WNOԀΌᴚS⊥∩ΛM⅄Z⇂ᘕԐત૨୧⌋8მ0˙ˋ¡¿\„,)(][}{"
)

return text.translate(flip_map)[::-1]
return text.translate(flip_map)[::-1]

def text_flip(flip_this):
converted_text = flipUD(flip_this)
print("The result is: ", converted_text)
pyperclip.copy(converted_text)
with open('flip_history.txt', 'a', encoding="utf-8") as f:
f.write('\n')
f.write(converted_text)
print("For convenience, I've placed the converted text into your keyboard.")
print("I also added it into a file called flip_history.txt, if it's easier to copy from there.")

def enchant_text(text):
enchanted_text1 = str.maketrans(
"abcdefghijklmnoqrstuvwzABCDEFGHIJKLMNOQRSTUVWZ1234567890.,!?\"'()[]{}",
"ᔑʖᓵ↸ᒷ⎓⊣⍑╎⋮ꖌꖎᒲリ𝙹ᑑ∷ᓭℸ⚍⍊∴Λᔑʖᓵ↸ᒷ⎓⊣⍑╎⋮ꖌꖎᒲリ𝙹ᑑ∷ᓭℸ⚍⍊∴Λ1234567890.,!?\"'()[]{}"
)
enchanted_text= text.translate(enchanted_text1)
enchanted_text = str(enchanted_text).replace('p', '!¡').replace('P', '!¡').replace('y', '||').replace('Y', '||').replace('x', '').replace('X', '')
enchanted_text = str(enchanted_text).replace('p', '!¡').replace('P', '!¡').replace('y', '||').replace('Y', '||').replace('x', ' ̇/').replace('X', ' ̇/')
print("The result is: ", enchanted_text)
pyperclip.copy(enchanted_text)
with open('enchant_history.txt', 'a', encoding="utf-8") as f:
f.write('\n')
f.write(enchanted_text)
print("For convenience, I've placed the converted text into your keyboard.")
print("I also added it into a file called enchant_history.txt, if it's easier to copy from there.")

def text_flip(flip_this):
converted_text = flipUD(flip_this)
print("The result is: ", converted_text)
pyperclip.copy(converted_text)
with open('flip_history.txt', 'a', encoding="utf-8") as f:
f.write('\n')
f.write(converted_text)
print("For convenience, I've placed the converted text into your keyboard.")
print("I also added it into a file called flip_history.txt, if it's easier to copy from there.")
print("I also added it into a file called enchant_history.txt, if it's easier to copy from there.")

def case_switch(case, text):
if case == 1:
Expand Down