First :D
This commit is contained in:
commit
37588421f3
100 changed files with 22673 additions and 0 deletions
73
plugins/munge.py
Normal file
73
plugins/munge.py
Normal file
|
@ -0,0 +1,73 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
from util import hook
|
||||
|
||||
|
||||
@hook.command
|
||||
def munge(inp, munge_count=0):
|
||||
".munge <text> -- munges up the given text"
|
||||
reps = 0
|
||||
for n in xrange(len(inp)):
|
||||
rep = character_replacements.get(inp[n])
|
||||
if rep:
|
||||
inp = inp[:n] + rep.decode('utf8') + inp[n + 1:]
|
||||
reps += 1
|
||||
if reps == munge_count:
|
||||
break
|
||||
return inp
|
||||
|
||||
|
||||
character_replacements = {
|
||||
'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': 'Q',
|
||||
'R': 'Ŗ',
|
||||
'S': 'Š',
|
||||
'T': 'Ţ',
|
||||
'U': 'Ů',
|
||||
# 'V': 'Ṿ',
|
||||
'W': 'Ŵ',
|
||||
'X': 'Χ',
|
||||
'Y': 'Ỳ',
|
||||
'Z': 'Ż'}
|
Reference in a new issue