Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
python/TextOddifier.py /
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
56 lines (50 sloc)
2.61 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Similar letter substituter | |
| # To make text look a bit strange | |
| # Now with added diacritics | |
| from random import choice | |
| SLD = { 'A':'ĀĂĄАѦѨӐӒӔḀẲⰡ⍲ᗗ','a':'āăąаѧѩӑӓӕḁẳ⎀', | |
| 'B':'ВѢҌ฿ḂḄḆᙗᙫ','b':'ЉЊБЪЬъыьѣҍḃḅḇᒀᖲ', | |
| 'C':'ĆĊČСҪℂ℃','c':'ćĉċčсҫ', | |
| 'D':'ĎĐḊḌḎḐḒ⫐⫒ᗫᗤ','d':'ďđԀԁԂԃḓḑḏḍḋᑽᖱ', | |
| 'E':'ĒĔĖĘĚŒЀЁЄЕѤӔӖԘ⋵⋶ᕮ','e':'ēĕėęěœеѐёѥӕӗԙ', | |
| 'F':'ҒӺḞ℉ᖴ','f':'ſғӻẛẜẝḟ', | |
| 'G':'ĜĞĠĢԌḠ','g':'ĝğġģḡ', | |
| 'H':'ĤĦЊНҔҢҤӇӉԊԢԨԪ','h':'ĥħЂЋђћҕңҥӈӊԡԦԧℎℏ', | |
| 'I':'ĨĪĬİIJІЇЮѤѨӀ','i':'ĩīĭįıijіїѩ༐༑', | |
| 'J':'IJĴЈЉӇԈԒԔᒏ','j':'ijĵЛјӈԓԕ', | |
| 'K':'ĶЌЖКҖҚҜҞҠӃԖԞԪ','k':'ķĸкҗқҝҟҡӄԗԟ', | |
| 'L':'ĹĻĽĿŁḶḸḺḼᒺ','l':'ĺļľŀłӏḷḹḻḽ', | |
| 'M':'МӍᴍḾṀṂ','m':'ӎᵚᵯmṃṁḿ', | |
| 'N':'ŃŅŇŊЍИЙҊӢӤ','n':'ńņňʼnŋҋᵰ', | |
| 'O':'ŌŎŐŒОЮѺӦ⥀⥁','o':'ōŏőœбоѻӧ', | |
| 'P':'РҎԖⰒⰐᑬᑭᑮᑶᑸ','p':'рҏԗᵱⱀᖰ', | |
| 'Q':'ҀԚⰢ','q':'ҁԛⱉᖳ', | |
| 'R':'ŔŖŘЯԄԆԖԘ℞ᖇ','r':'ŕŗřѓг', | |
| 'S':'ŚŜŞŠЅṦṨᔡ','s':'śŝşšѕᵴṩṧṥ', | |
| 'T':'ŢŤŦЂЃЋГТѢѢҬԎ','t':'ţťŧҭԏ', | |
| 'U':'ŨŪŬŮŰŲ⩂⩁⋃ᙈᙀ','u':'ũūŭůűų', | |
| 'V':'ѴѶṼṾⰜ⩢⩣⩛⩝⍱⋁ᐻ','v':'ѵѷṿṽⱌ⩡', | |
| 'W':'ŴѠѼѾԜ','w':'ŵѡѽѿԝ⍹', | |
| 'X':'ЖХҖӁӜӼӾԔ','x':'жхҗӂӝӽӿԕẋ', | |
| 'Y':'ŶŸЎУҮӮӰӲ','y':'ŷуўӯӱӳ', | |
| 'Z':'ŹŻŽᤏᤁ','z':'źżžᙇ', | |
| '.':'.․⁝⁞', | |
| '?':'?‽⁇⁈', | |
| '!':'!‽⁉', | |
| } | |
| DIA = (779,848,852,823,813,864,860,838,804,842,775,797,798,790,778,811,858,841,803,819,776,853,815,771,802,840,828,857, | |
| 792,796,824,856,814,781,825,830,788,836,795,829,832,800,837,855,806,826,785,801,769,818,861,791,843,784,859,817, | |
| 789,833,772,793,782,794,834,851,812,820,810,854,768,786,780,774,805,809,808,850,822,783,839,846,849,845,835,827, | |
| 807,831,787,773,777,821,816,844,799,770) | |
| def oddify(text): | |
| result = "" | |
| for i in text: | |
| try: result += choice(SLD[i]) | |
| except: | |
| result += i | |
| # we can add as many diacritics as we like, but for now, just add one. | |
| result += chr(choice(DIA)) | |
| return result | |
| s = input("enter the text you want to oddify: ") | |
| print(oddify(s)) | |
| input("Press enter when done:") |