Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

檀 in Traditional Chinese does not get converted to 坛 #14

Open
chewsihui95 opened this issue Jul 17, 2018 · 1 comment
Open

檀 in Traditional Chinese does not get converted to 坛 #14

chewsihui95 opened this issue Jul 17, 2018 · 1 comment

Comments

@chewsihui95
Copy link

Below is what I see in the shell:

Python 3.5.4 (v3.5.4:3f56838, Aug 8 2017, 02:17:05) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.

from hanziconv import HanziConv
HanziConv.toSimplified("把中檀元帅固定在神轿")
'把中檀元帅固定在神轿'

檀 should become 坛. 中檀元帅 is the name of a Taoist deity, if it helps with troubleshooting.

Let me know if more information is needed.

@loretoparisi
Copy link

@chewsihui95 at the end of the charmap I have added

addon_traditional = ''.join(textwrap.dedent("""

""").split())

addon_simplified = ''.join(textwrap.dedent("""

""").split())

simplified_charmap = cuhk_simplified + extra_simplified + addon_simplified
traditional_charmap = cuhk_traditional + extra_traditional + addon_traditional

So now If I do

print(HanziConv.toSimplified("把中檀元帅固定在神轿"))
把中坛元帅固定在神轿

That seems to be correct.
I have noticed that, according to Google Translate, the correct word is 把中壇元帥固定在神轎 (so, third char should be and not ). In that case it works fine with the character you suggested:
https://translate.google.com/?rlz=1C5CHFA_enIT832IT832&um=1&ie=UTF-8&hl=en&client=tw-ob#view=home&op=translate&sl=zh-CN&tl=zh-CN&text=%E6%8A%8A%E4%B8%AD%E5%A3%87%E5%85%83%E5%B8%A5%E5%9B%BA%E5%AE%9A%E5%9C%A8%E7%A5%9E%E8%BD%8E

by the way if you do

print(HanziConv.toSimplified("把中檀元帅固定在神轿"))
print(HanziConv.toSimplified("把中壇元帥固定在神轎"))
# 把中坛元帅固定在神轿

here works ok with the same result of Google Translate :)

NOTE. I'm not Chinese native speaker, so I do not know why Google is suggesting instead of . In any case your add-on is correct!

loretoparisi added a commit to loretoparisi/hanziconv that referenced this issue Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants