-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sort treats numbers as strings #31
Comments
Given how dicey mixing numeric and lexicographic sorting strategies on mixed strings can be, if you want any input or help testing leading up to release for this just let me know. This is something I deal with on a daily basis and it's the pain in the @$$ with the wrong sorting implementation. Haven't yet found a good solution from other plugins either, so happy to see this show up on the list. Edit: My use case may be slightly different, actually; dealing with sorting strings that potentially begin with a number, date or time string. I can drop it in a separate issue still if you like. |
To clarify, if you have this:
Would you need those sorted by the initial number?
This is my thinking:
Thanks for the offer to test, I can either share a private |
Close to that, yes, though number 2 could introduce some undesirable results with edge cases involving datetime stamps in universal sortable format and log entries (depends on what ruleset you follow for tokenizing words, and how special characters are treated also I guess). I’ll be back at PC in the next hour and can give a slightly more specific answer then. I do agree this is best as aseparate sort option, as it increases the complexity of the comparator and in plenty of casual use cases a strictly lexicographer or numeric sort is sufficient anyways. |
My apologies for the delay in my response; had to replace my i7 SkyLake from ~8 years ago, and the delays set me back a good bit. During my down time, however, I did have a chance to think through this a little more, and IMHO due to the numerous possible use-case scenarios and parsing "gotchas" (a couple of which you already brought up), this really should be considered as a new feature set with it's own set of sorting rules to chose from - above and beyond what this issue originally addressed. In the interest of not holding up this specific issue, I'll create a discussion with my thoughts on the additional sorting ideas, which you can convert to an issue at your discretion when something has been fleshed out. I've put together a few notes already, along with some sample string lists representing some of the most common scenarios in my experience which prompted my comment to begin with, which I'll include in the discussion. |
The text was updated successfully, but these errors were encountered: