Opened 8 years ago

Last modified 6 years ago

#11021 new Feature Requests

Natural sort

Reported by: gast128@… Owned by: Marshall Clow
Milestone: To Be Determined Component: string_algo
Version: Boost 1.57.0 Severity: Cosmetic
Keywords: Cc:

Description

Alphabetically sorting gives unwanted results for humans. For example the following strings get sorted this way: Arena 1 Arena 10 Arena 2

What humans like is: Arena 1 Arena 2 Arena 10

This is not trivial since the numbers can appear anywhere. Would this be a nice extension for Boost as well? Microsoft has solved this in StrCmpLogicalW. See also 'sorting-for-humans-natural-sort-order' (can't include a link; I get a trac-think-it-is-a-spam error).

Change History (2)

comment:1 by gagan1kumar@…, 7 years ago

I too think NaturalSort can be a good extension, Thus I have tried an implementation for NaturalSort here https://github.com/scopeInfinity/NaturalSort , Can you please take a look at it. Or guide me to make it better.

comment:2 by Alexander Zaitsev <zamazan4ik@…>, 6 years ago

I think that it will be a good extension to Boost.Algortihm. In the Internet there are many implementations of Natural Sort (also, in C++). I think we can add this algorithm to the library in easy way.

Note: See TracTickets for help on using tickets.