Live data from Hacker News

When I say “alphabetical order”, I mean “alphabetical order”

sebastiano.tronto.net

1–10 of 385 posts

Re: When I say “alphabetical order”, I mean “alphabetical order”

#2
https://www.unicode.org/reports/tr10/#Contextual_Sensitivity:

“There are additional complications in certain languages, where the comparison is context sensitive and depends on more than just single characters compared directly against one another,

[…]

Numbers. A customization may be desired to allow sorting numbers in numeric order. If strings including numbers are merely sorted alphabetically, the string “A-10” comes before the string “A-2”, which is often not desired. This behavior can be customized, but it is complicated by ambiguities in recognizing numbers within strings (because they may be formatted according to different language conventions). Once each number is recognized, it can be preprocessed to convert it into a format that allows for correct numeric sorting, such as a textual version of the IEEE numeric format.”*

I think those file browsers made the right choice, even given that they don’t (as in this example) always do the right thing.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#3
I almost always want the version-sorting that's being presented in this article, rather than an "alphabetical" sort. But on the other hand, it absolutely seems like a valid bug that this is presented as an "alphabetical" sort, rather than something like "alphabetic/numeric" or similar. In other words, a problem of labeling rather than one of sorting.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#4
If I understand the article, the author wants magic :)

I take it to mean they want the system to know file_9.txt is less then file_10.txt.

I never saw that happen in any OS, so I do not know what he is referring to. Maybe whatever that old system was, it sorted by create time as opposed to file name.

So, the author can try and create "aisort" that will look at all file names and add leading zeros to the file numeric portion, sort, then remove the zeros added. That will probably as slow as s***t and use gobs pf memory, depending on the number of files.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#5
post #4

If I understand the article, the author wants magic :) I take it to mean they want the system to know file_9.txt is less then file_10.txt. I never saw that happen in any OS, so I do not know what he is referring to. Maybe whatever that old system was, it sorted by create time as opposed to file name. So, the author can try and create "aisort" that will look at all file names and add leading zeros to the file numeric…

No the author is saying the opposite. They expect file9.txt to be after file10.txt, but it many modern operating systems, it isn’t!

Re: When I say “alphabetical order”, I mean “alphabetical order”

#6
post #4

If I understand the article, the author wants magic :) I take it to mean they want the system to know file_9.txt is less then file_10.txt. I never saw that happen in any OS, so I do not know what he is referring to. Maybe whatever that old system was, it sorted by create time as opposed to file name. So, the author can try and create "aisort" that will look at all file names and add leading zeros to the file numeric…

i think it's the opposite, that they _want_ file_10.txt to come before file_9.txt by default, but that file explorers fail at this. it's rare that i want true alphabetical sort, but it's convenient for cases like tfa where alphabetical sort is more predictable if i have filenames that look like _.txt.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#7
post #4

If I understand the article, the author wants magic :) I take it to mean they want the system to know file_9.txt is less then file_10.txt. I never saw that happen in any OS, so I do not know what he is referring to. Maybe whatever that old system was, it sorted by create time as opposed to file name. So, the author can try and create "aisort" that will look at all file names and add leading zeros to the file numeric…

That's not what the author says- they said that file managers actually are somehow sorting file-9.txt before file-10.txt, and it's breaking real alphabetical ordering.

Re: When I say “alphabetical order”, I mean “alphabetical order”

#9
"I created the Alphanum Algorithm to solve this problem. The Alphanum Algorithm sorts strings containing a mix of letters and numbers. Given strings of mixed characters and numbers, it sorts the numbers in value order, while sorting the non-numbers in ASCII order. The end result is a natural sorting order."

https://web.archive.org/web/20210207124255/http://www.daveko...

Re: When I say “alphabetical order”, I mean “alphabetical order”

#10
post #2

https://www.unicode.org/reports/tr10/#Contextual_Sensitivity : “There are additional complications in certain languages, where the comparison is context sensitive and depends on more than just single characters compared directly against one another, […] Numbers. A customization may be desired to allow sorting numbers in numeric order. If strings including numbers are merely sorted alphabetically, the string “A-10” co…

But -10 is smaller than -2, right?
Post reply on HN