polm / cutlet

Japanese to romaji converter in Python
https://polm.github.io/cutlet/
MIT License
286 stars 20 forks source link

Japanese city names in romaji #36

Closed tingwoo closed 1 year ago

tingwoo commented 1 year ago

Why are city names like 東京 and 大阪 converted to Tokyo and Osaka instead of Toukyou and Oosaka? I am working on a text-to-speech project and it caused the program to pronounce them incorrectly.

polm commented 1 year ago

This happens because of the exceptions list. The README mentions this right at the top with those two specific examples.

2023-08-26T23-58-16

Those two are in the exception list because those are the conventional romanizations of those city names. If you want to disable the behavior, you can just blank the exceptions list.

cut = cutlet.Cutlet()
cut.exceptions = {}
cut.romaji("東京と大阪")
# => Toukyou to Oosaka
tingwoo commented 1 year ago

Ahh I see! That's a dumb question. Thank you for the amazing tool.