You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Ma Yun " (notice the space in the end) instead of
"Ma Yun"
Here's the code you can use to replicate this issue:
importunittestimportunidecodeclassTestStrings(unittest.TestCase):
deftest_replace_non_ascii_letters_with_chinese_name(self):
self.assertEquals(unidecode.unidecode("马云"), "Ma Yun")
The test fails with the following error:
AssertionError: 'Ma Yun ' != 'Ma Yun'
- Ma Yun
? -
+ Ma Yun
Run on Python 3.8.5
EDIT:
Google Translate seems to be doing this with no issue, but perhaps Google Translate has the faulty transliteration. Chinese speakers welcome to correct me.
The text was updated successfully, but these errors were encountered:
The technical reason why transliteration for each letter includes a space at the end is because otherwise you would not get spaces between letters. In your example you would get "MaYun". Unidecode just does a simple mapping from a Unicode character to ASCII sequences and doesn't know which letter appears last in your name. Hence the last letter will leave a trailing space.
I don't speak Chines, but the original author of Unidecode thought it was better to have spaces so I will leave it like that.
When trying to transliterate
"马云"
I receive
"Ma Yun " (notice the space in the end) instead of
"Ma Yun"
Here's the code you can use to replicate this issue:
The test fails with the following error:
Run on Python 3.8.5
EDIT:
Google Translate seems to be doing this with no issue, but perhaps Google Translate has the faulty transliteration. Chinese speakers welcome to correct me.

The text was updated successfully, but these errors were encountered: