diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2005-02-15 17:17:56 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2005-02-15 17:17:56 +0000 |
commit | 5647ec07bbd4e0a7f0f9adde91dc864e5cda0816 (patch) | |
tree | cb4fd63e0764d05c969b03e9b8fd52f8e36af84a /textproc/p5-Sort-Naturally/pkg-descr | |
parent | b4d05fbdaf5698fee3b30c8afb79a790a299155b (diff) | |
download | ports-5647ec07bbd4e0a7f0f9adde91dc864e5cda0816.tar.gz ports-5647ec07bbd4e0a7f0f9adde91dc864e5cda0816.zip |
Notes
Diffstat (limited to 'textproc/p5-Sort-Naturally/pkg-descr')
-rw-r--r-- | textproc/p5-Sort-Naturally/pkg-descr | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/textproc/p5-Sort-Naturally/pkg-descr b/textproc/p5-Sort-Naturally/pkg-descr new file mode 100644 index 000000000000..ce307f00f03b --- /dev/null +++ b/textproc/p5-Sort-Naturally/pkg-descr @@ -0,0 +1,31 @@ +This module exports two functions, nsort and ncmp; they are used in implementing +my idea of a "natural sorting" algorithm. Under natural sorting, numeric +substrings are compared numerically, and other word-characters are compared +lexically. + +This is the way I define natural sorting: + + * Non-numeric word-character substrings are sorted lexically, +case-insensitively: "Foo" comes between "fish" and "fowl". + * Numeric substrings are sorted numerically: "100" comes after "20", +not before. + * \W substrings (neither words-characters nor digits) are ignored. Our use + * of \w, \d, \D, and \W is locale-sensitive: Sort::Naturally +uses a use locale statement. + * When comparing two strings, where a numeric substring in one place +is not up against a numeric substring in another, the non-numeric always comes +first. This is fudged by reading pretending that the lack of a number substring +has the value -1, like so: + * The start of a string is exceptional: leading non-\W (non-word, +non-digit) components are are ignored, and numbers come before letters. + * I define "numeric substring" just as sequences matching m/\d+/ -- +scientific notation, commas, decimals, etc., are not seen. If your data has +thousands separators in numbers ("20,000 Leagues Under The Sea" or "20.000 +lieues sous les mers"), consider stripping them before feeding them to nsort or +ncmp. + +WWW: http://search.cpan.org/dist/Sort-Naturally/ +Author: Sean M. Burke <sburke@cpan.org> + +- Aaron Dalton +aaron@daltons.ca |