fix hiragana-katakana conversion

This commit is contained in:
wareya committed 2019-06-29 10:01:47 -04:00
1 parent 0408da797d
commit de47e41c33
7 files changed
+89159 -4730

No files matched your search

+3 -1
View File
@@ -7,7 +7,9 @@ def replace_kata_with_hira(text):
newtext = ""
for c in text:
codepoint = ord(c)
if codepoint >= 0x30A0 and codepoint <= 0x30FF:
if codepoint >= 0x30A0 and codepoint <= 0x30F6:
codepoint -= (0x30A0 - 0x3040)
elif codepoint >= 0x30FD and codepoint <= 0x30FE:
codepoint -= (0x30A0 - 0x3040)
newtext += chr(codepoint)
return newtext