Text::Normalize::NACO - Normalize text based on the NACO rules
# exported method use Text::Normalize::NACO qw( naco_normalize ); $normalized = naco_normalize( $original ); # as an object $naco = Text::Normalize::NACO->new; $normalized = $naco->normalize( $original ); # normalize to lowercase $naco->case( 'lower' ); $normalized = $naco->normalize( $original );
In general, normalization is defined as:
To make (a text or language) regular and consistent, especially with respect to spelling or style.
It is commonly used for comparative purposes. These particular normalization rules have been set out by the Name Authority Cooperative. The rules are described in detail at: http://www.loc.gov/catdir/pcc/naco/normrule.html
perl Makefile.PL make make test make install
Creates a new Text::Normalize::NACO object. You explicitly request strings to be normalized in upper or lower-case by setting the "case" option (defaults to "upper").
my $naco = Text::Normalize::NACO->new( case => 'lower' );
Accessor/Mutator for the case in which the string should be returned.
# lower-case $naco->case( 'lower' ); # upper-case $naco->case( 'upper' );
Exported version of normalize. You can specify any extra options by passing a hashref after the string to be normalized.
normalize
my $normalized = naco_normalize( $original, { case => 'lower' } );
Normalizes $text and returns the new string.
my $normalized = $naco->normalize( $original );
http://www.loc.gov/catdir/pcc/naco/normrule.html
Brian Cassidy <bricas@cpan.org>
Copyright 2004-2009 by Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Text::Normalize::NACO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Normalize::NACO
CPAN shell
perl -MCPAN -e shell install Text::Normalize::NACO
For more information on module installation, please visit the detailed CPAN module installation guide.