-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Sort Greek and Hebrew characters #26145
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
Conversation
syms = sorted(list(syms)) | ||
# Assume that lists are correctly sorted | ||
if isinstance(syms, set): | ||
syms = sorted(list(syms)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syms = sorted(list(syms)) | |
syms = sorted(syms) |
sets are iterable so sorted
can take them directly.
Super picky, take it or leave it.
\upsilon \xi \zeta \digamma \varepsilon \varkappa \varphi | ||
\varpi \varrho \varsigma \vartheta""".split()], | ||
r"""\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa \lambda \mu | ||
\nu \xi \pi \rho \sigma \tau \upsilon \phi \psi \chi \omega \digamma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\nu \xi \pi \rho \sigma \tau \upsilon \phi \psi \chi \omega \digamma | |
\nu \xi \pi \rho \sigma \tau \upsilon \phi \chi \psi \omega \digamma |
wiki says "..., Φ φ, Χ χ, Ψ ψ, ..."
\varpi \varrho \varsigma \vartheta""".split()], | ||
r"""\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \kappa \lambda \mu | ||
\nu \xi \pi \rho \sigma \tau \upsilon \phi \psi \chi \omega \digamma | ||
\varepsilon \vartheta \varkappa \varphi \varpi \varrho \varsigma""".split()], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to put the \var
versions with their normal versions or all at the end like tihs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. :-)
["Hebrew", | ||
6, | ||
r"""\aleph \beth \daleth \gimel""".split()], | ||
r"""\aleph \beth \gimel \daleth""".split()], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r"""\aleph \beth \gimel \daleth""".split()], | |
r"""\daleth \gimel \beth \aleph""".split()], |
I trust @story645 's suggestion that the Hebrew should be ordered right-to-left.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, missed that aspect of it.
I think this is a more direct approach than #26142 . This is a script we control for building docs, if we want them ordered....just put them in order and rely on latin alphabet sorting for the symbols. |
but why when if we use the rendered characters then we can rely on those alphabets for sorting? I don't get why we're like "for English we'll sort on English, for other languages we'll manually sort" |
Pragmatically, it is unlikely that the Greek alphabet is going to get any additional letters and the correct sorting on the Greek and Hebrew is not equivalent to the lexigraphical sorting. Just putting them in order is the least 8000 work and requires no maintenance. On the other hand, it is possible (and certainly more likely) that we may pick up additional math symbols and the math symbols have no natural sorting, so go with lexical sorting. I guess we could pre-sort them too, but then if we ever do add a new symbol to the set we would have to worry about keep them in order. |
The sorting code is already written, so there's no more upfront work except a review...putting em in order - which requires verifying it's in order - only requires no maintenance if we don't touch those datasets - otherwise every time they get touched someone needs to double check that they stay in order (which needs to be documented). Eta: I guess I'm confused/slightly frustrated cause I mostly don't think I'm doing anything fancy by using different sorting keys. Eta2: another way of putting it is having the sort be auto at the end removes the constraint of requiring that the lists be sorted. Eta3: poking at this more, what I think I'm really pushing for is a kind of localized responsibility - printing the table is why sort matters, so let the printing enforce the sort. |
Closing this as #26142 has evolved. |
PR summary
Closes #26142 (alternative)
PR checklist