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

Output of reverse() does not align with output of parse() for the same word #86

Open
ruviet opened this issue Dec 27, 2024 · 4 comments

Comments

@ruviet
Copy link

ruviet commented Dec 27, 2024

$ python3
Python 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import avro
>>> avro.parse("kingkorrtobybimURh")
'কিংকর্তব্যবিমূঢ়'
>>> avro.reverse(_)
'kingokoro্toboZzbimuRh'-
>>> avro.parse(_)
'কিঙ্গকর্তবঅ্যযবিমুঢ়'
>>> 

If parse('x') = y, reverse('y') should output exactly 'x'.

Thanks a ton for making avro.py, btw :)

@hitblast
Copy link
Owner

$ python3
Python 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import avro
>>> avro.parse("kingkorrtobybimURh")
'কিংকর্তব্যবিমূঢ়'
>>> avro.reverse(_)
'kingokoro্toboZzbimuRh'-
>>> avro.parse(_)
'কিঙ্গকর্তবঅ্যযবিমুঢ়'
>>> 

If parse('x') = y, reverse('y') should output exactly 'x'.

Thanks a ton for making avro.py, btw :)

@ruviet Thanks for mentioning the issue! Actually, the design is on purpose since sometimes the output from the reverse() function needs to be sanitized beforehand in order for a "readable" text. However, your issue might indicate the need for a raw-reversal function.

@hitblast
Copy link
Owner

@baseplate-admin Would like your thoughts on this one.

@baseplate-admin
Copy link
Contributor

baseplate-admin commented Dec 28, 2024

Thanks for mentioning the issue! Actually, the design is on purpose since sometimes the output from the reverse() function needs to be sanitized beforehand in order for a "readable" text.

I think the thought process is correct, Add something of raw reversal is the better way, since in avro the dictionary by design is lossy.

@ruviet
Copy link
Author

ruviet commented Dec 29, 2024

Thanks for the quick response!

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

3 participants