BSD Ports

textproc/p5-Sort-Naturally 1.03_1 FreeBSD

Sort lexically, but sort numeral parts numerically

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
License
ART10, GPLv1+
Categories
textproc, perl5
Package size
14.4 KiB, 33.3 KiB installed

Description

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 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.

In the other systems

SystemPortVersion
FreeBSDtextproc/p5-Sort-Naturally1.03_1
OpenBSDdevel/p5-Sort-Naturally1.03p0
NetBSDdevel/p5-Sort-Naturally1.03nb14
DragonFlytextproc/p5-Sort-Naturally1.03_1
MidnightBSDtextproc/p5-Sort-Naturally1.03_1

Install

Binary package:

pkg install p5-Sort-Naturally

From the ports tree:

cd /usr/ports/textproc/p5-Sort-Naturally/ && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	p5-Sort-Naturally>0:textproc/p5-Sort-Naturally

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest1.03_11.03_11.03_11.03_11.03_1
FreeBSD:14:quarterly1.03_11.03_1n/a1.03_11.03_1
FreeBSD:15:latest1.03_11.03_1n/a1.03_11.03_1
FreeBSD:15:quarterly1.03_11.03_1n/an/an/a
FreeBSD:16:latest1.03_11.03_1n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

The Makefile names none itself; they come from USES and USE_*.

The full lists below include those, and their dependencies in turn.

Build dependencies 1
Run dependencies 1

Configuration

No options to configure.

USES
perl5
Service scripts
none

Files

pkg-plist 2
  • %%PERL5_MAN3%%/Sort::Naturally.3.gz
  • %%SITE_PERL%%/Sort/Naturally.pm
distinfo 1
FileSizeSHA256
Sort-Naturally-1.03.tar.gz11150eaab1c5c87575a7826089304ab1f8ffa7f18e6cd8b3937623e998e865ec1e746
Master sites 1
  • CPAN

Commit history 0

No commits in the history this site was built from.