This commit is contained in:
Araq 2018-08-30 15:33:34 +02:00
commit a14ffd6119
3 changed files with 436 additions and 436 deletions

View file

@ -5,22 +5,22 @@
# (c) 2010 Andreas Rumpf # (c) 2010 Andreas Rumpf
from unidecode import unidecode from unidecode import unidecode
import warnings
warnings.simplefilter("ignore")
def main2(): def main2():
data = [] data = []
for x in xrange(128, 0xffff + 1): for x in range(128, 0xffff + 1):
u = eval("u'\u%04x'" % x) u = eval("u'\\u%04x'" % x)
val = unidecode(u) val = unidecode(u)
data.append(val) data.append(val)
f = open("unidecode.dat", "w+")
f = open("unidecode.dat", "wb+")
for d in data: for d in data:
f.write("%s\n" % d) f.write("%s\n" % d)
f.close() f.close()
main2() main2()

File diff suppressed because it is too large Load diff

View file

@ -69,5 +69,5 @@ proc unidecode*(s: string): string =
when isMainModule: when isMainModule:
loadUnidecodeTable("lib/pure/unidecode/unidecode.dat") loadUnidecodeTable("lib/pure/unidecode/unidecode.dat")
assert unidecode("Äußerst") == "Ausserst" doAassert unidecode("Äußerst") == "Ausserst"
doAssert unidecode("北京") == "Bei Jing"