Tweak deskutils/bijiben version 3.14.2
[dports.git] / textproc / p5-Sort-Naturally / pkg-descr
1 This module exports two functions, nsort and ncmp; they are used in implementing
2 my idea of a "natural sorting" algorithm. Under natural sorting, numeric
3 substrings are compared numerically, and other word-characters are compared
4 lexically.
5
6 This is the way I define natural sorting:
7
8     * Non-numeric word-character substrings are sorted lexically,
9 case-insensitively: "Foo" comes between "fish" and "fowl".
10     * Numeric substrings are sorted numerically: "100" comes after "20",
11 not before.
12     * \W substrings (neither words-characters nor digits) are ignored.  Our use
13     * of \w, \d, \D, and \W is locale-sensitive: Sort::Naturally
14 uses a use locale statement.
15     * When comparing two strings, where a numeric substring in one place
16 is not up against a numeric substring in another, the non-numeric always comes
17 first. This is fudged by reading pretending that the lack of a number substring
18 has the value -1, like so:
19     * The start of a string is exceptional: leading non-\W (non-word,
20 non-digit) components are ignored, and numbers come before letters.
21     * I define "numeric substring" just as sequences matching m/\d+/ --
22 scientific notation, commas, decimals, etc., are not seen. If your data has
23 thousands separators in numbers ("20,000 Leagues Under The Sea" or "20.000
24 lieues sous les mers"), consider stripping them before feeding them to nsort or
25 ncmp.
26
27 WWW: http://search.cpan.org/dist/Sort-Naturally/