fixes #8768
This commit is contained in:
parent
3e6b58323b
commit
a14ffd6119
3 changed files with 436 additions and 436 deletions
|
|
@ -5,22 +5,22 @@
|
||||||
# (c) 2010 Andreas Rumpf
|
# (c) 2010 Andreas Rumpf
|
||||||
|
|
||||||
from unidecode import unidecode
|
from unidecode import unidecode
|
||||||
|
import warnings
|
||||||
|
|
||||||
def main2():
|
warnings.simplefilter("ignore")
|
||||||
|
|
||||||
|
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
|
|
@ -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"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue