Skip to content

Instantly share code, notes, and snippets.

@fzerorubigd
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fzerorubigd/c8b53fa3231f28f40092 to your computer and use it in GitHub Desktop.
Save fzerorubigd/c8b53fa3231f28f40092 to your computer and use it in GitHub Desktop.
~/.thefuck/rules/persian.py
# coding=utf-8
local_charlist = {u'،':'&' , u'×':'^' , u'٪':'%' , u'﷼':'$' , u'٫':'#' , u'٬':'@' , u'!':'!' , u'۰':'0' , u'۹':'9' , u'۸':'8' , u'۷':'7' , u'۶':'6' , u'۵':'5' , u'۴':'4' , u'۳':'3' , u'۲':'2' , u'۱':'1' , u'و':',' , u'پ':'m' , u'د':'n' , u'ذ':'b' , u'ر':'v' , u'ز':'c' , u'ط':'x' , u'ظ':'z' , u'گ':'\'' , u'ک':';' , u'م':'l' , u'ن':'k' , u'ت':'j' , u'ا':'h' , u'ل':'g' , u'ب':'f' , u'ی':'d' , u'س':'s' , u'ش':'a' , u'چ':']' , u'ج':'[' , u'ح':'p' , u'خ':'o' , u'ه':'i' , u'ع':'u' , u'غ':'y' , u'ف':'t' , u'ق':'r' , u'ث':'e' , u'ص':'w' , u'ض':'q' }
def match(command, settings):
c = command.script
return c[0] in local_charlist
def get_new_command(command, settings):
res = ""
for c in command.script:
if c in local_charlist:
res = res + local_charlist[c]
else:
res = res + c
return '{}'.format(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment