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

Kanji characters not being translated, but Hiragana characters are translated #32

Open
marv72 opened this issue Nov 18, 2019 · 1 comment

Comments

@marv72
Copy link

marv72 commented Nov 18, 2019

kana.IsKanji("減少") recognises that it has Kanji characters but KanaToRomaji does not translate to Romaji it just leaves it as Kanji, Go Playground link below:

https://play.golang.org/p/qxeMAYoSqtk

So I can translate Hiragana characters but not Kanji characters, is that by design?

@shawnps
Copy link
Contributor

shawnps commented Nov 19, 2019

Hi @marv72 yes, this library only converts between hiragana, katakana, and romaji. We built this many years ago for use in our Japanese dictionary https://nihongo.io. I suppose we only did hiragana/katakana support for purposes of speed -- kanji would require building a large data structure and would slow the library down.

We use this library on nihongo.io to detect whether a word is Latin-based, and if it is we convert it to hiragana and katakana and search:

https://github.com/gojp/nihongo/blob/master/lib/dictionary/dictionary.go#L104-L110

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