-
Notifications
You must be signed in to change notification settings - Fork 62
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
Handling of conversions near punctuation #81
Comments
The extra space was introduced in b8af436 to prevent fractions from merging with adjacent numbers. |
Yes, I think that adding the extra space at the start to prevent the merging is good, but I wonder if the extra trailing space is needed? I can't currently think of any examples where something deliberately adjacent & following a fraction such as ¾ would require a space separation. I expect other trailing numbers would already have a space in the original string. (But preceding numbers may not, in which case I agree introducing a space there is a good thing). |
@IamJeffG Since you contributed the commit that added the spaces, do you have any objection to removing the trailing space? |
I have no objection to that change. I do often deal with ranges like If anyone is out there who's parsing strings like |
Thank you both for your comments. I'm removing the trailing space in the replacements for fractions. I'll be releasing a new version of Unidecode with this change shortly. |
This prevents adding an extra space between fraction and punctuation in strings like "Platform 9¾, Kingʹs Cross Station". Closes avian2#81
This prevents adding an extra space between fraction and punctuation in strings like "Platform 9¾, Kingʹs Cross Station". Closes avian2#81
This prevents adding an extra space between fraction and punctuation in strings like "Platform 9¾, Kingʹs Cross Station". Closes avian2#81
I recently upgraded unidecode, and saw some failing test.
The test in question:
The result:
I think that separating the 9 from the 3/4 is a good idea, so as to distinguish it from the possibility of
93 / 4
(which the original is not), however there is also a space placed between the3/4
and the comma which does not read well.Not a major issue but probably something that will bug people.
The text was updated successfully, but these errors were encountered: