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

Different output to_latin for v1.0 and v1.1 #37

Open
matteomedioli opened this issue Feb 7, 2023 · 6 comments
Open

Different output to_latin for v1.0 and v1.1 #37

matteomedioli opened this issue Feb 7, 2023 · 6 comments

Comments

@matteomedioli
Copy link

I received different outputs for the same inputs based on code version:

Version: 1.0

>>> import cyrtranslit
>>> cyrtranslit.to_latin("Я часто пью водку", "ru")
"JA chasto p'ju vodku"

Version: 1.1

>>> import cyrtranslit
>>> cyrtranslit.to_latin("Я часто пью водку", "ru")
"YA chasto p'yu vodku"
@georgeslabreche
Copy link
Collaborator

Thank you for flagging this! Which one is the correct one? cc @ratijas and @rominf.

@ratijas
Copy link
Contributor

ratijas commented Feb 7, 2023

Hi

First of all, it took me quite some time to realize what did I do to this project in past that I'm being tagged here. But that's fine :)

I did a quick refresh on romanization of languages. According to a comparison table on Wikipedia, it seems there are multiple options to choose from, either is correct according to one standard or another.

https://en.wikipedia.org/wiki/Romanization_of_Russian#Transliteration_table

To make things completely absurd, there's even "я" -> "ia" variant for passports!

So, I think, the question is malformed, and can not be answered without specifying particular standard as well 🙃

@georgeslabreche
Copy link
Collaborator

Thank you @ratijas for your input! Sorry for the unsolicited tagging😬.

@rominf
Copy link
Contributor

rominf commented Feb 8, 2023

Hi, @georgeslabreche.

I agree with what @ratijas said: standards matter. My variant is based on the standard of Russian government (and it's mentioned in the PR), while first version of Russian transliteration is apparently not based on any standard (at least, I'm not aware of it and the PR doesn't mention it). Speaking of this particular example: "я" -> "ja" or "ya", the latter one is more popular in Russia, take https://en.wikipedia.org/wiki/Yandex for example.

It was me who broke the compatibility, but I believe I did the right thing (standards matter more than compatibility). It was clear from tests that the compatibility is broken, but probably I should have emphasize this in the PR/commit messages and recommend you to create version 2.0 to follow semantic versioning. Sorry about that.

If you want to provide full coverage (hard, especially Latin -> Cyrillic), you probably want to add scheme argument as it's done here: https://github.com/nalgeon/iuliia-py.

@georgeslabreche
Copy link
Collaborator

georgeslabreche commented Feb 8, 2023

I agree with both of you, thank you for your inputs and clarification. @rominf: no need to apologize, it's an excellent contribution.

I like the schema approach. However, I'm not sure if I'll go ahead with implementing something similar in the near feature since iuliia already offers that elegant alternative for Russian transliteration.

@rominf
Copy link
Contributor

rominf commented Feb 8, 2023

@georgeslabreche Just in case: iuliia offers only Cyrillic -> Latin, but not the other way around (which was important to me because I've tried to create TTS for mixed text in Cyrillic and Latin based on Russian voice), this is why I search for other libraries, found your library, wasn't fully satisfied by it, and did my contribution. So, your library is not fully comparable to iuliia, they have different use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants