каждое слово мне приходится переводить
свой уровень оцениваю в pre-intermediate
from collections import Counter
co = Counter("шуршу шумом")
total, lo = sum(co.values()), 0
for k, v in co.most_common():
hi = lo + v
print('%f\t%c\t%f' % (lo / total, k, hi / total))
lo = hi
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="100" height="100">
<circle r="1" cx="70" cy="50" fill="black" stroke-width="5" />
<circle r="1" cx="70" cy="54" fill="black" stroke-width="5" />
<circle r="1" cx="70" cy="58" fill="black" stroke-width="5" />
<circle r="1" cx="70" cy="62" fill="black" stroke-width="5" />
<path d="m 30,30 0,40" style="fill:none;fill-rule:evenodd;stroke:#000000;
stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;
stroke-miterlimit:4;stroke-dasharray:3,3;stroke-dashoffset:0" />
</svg>
print(re.sub(r'(\w)\1+', r'\1\1',
'veююююvno b fffa a aaaaa nkacvak 777 aa'))
def f(m):
s = m.group(0)
return s if s[0].isdigit() else s[:2]
print(re.sub(r'(\w)\1+', f,
'на любом языке - так на любом 777 aa მუუუუნჯი 慕尼尼尼尼黑 '))
print(re.sub(r'([^\W\d])\1+', r'\1\1',
'veююююvno b fffa a aaaaa nkacvak 777 aa მუუუუნჯი 慕尼尼尼尼黑 '))