no warnings 'utf8';
-our $VERSION = '0.50';
+our $VERSION = '0.51';
our $PACKAGE = __PACKAGE__;
my @Path = qw(Unicode Collate);
last if open($fh, $f);
$f = undef;
}
- defined $f
- or croak "$PACKAGE: $self->{table} is not found in @INC";
+ if (!defined $f) {
+ $f = File::Spec->catfile(@Path, $self->{table});
+ croak("$PACKAGE: Can't locate $f in \@INC (\@INC contains: @INC)");
+ }
while (<$fh>) {
next if /^\s*#/;
The supported tracking version: 8, 9, 11, or 14.
- UCA tracking version Unicode version
- 8 3.1
- 9 3.1 with Corrigendum 3
- 11 4.0
- 14 4.1.0
+ UCA Unicode Standard DUCET (@version)
+ ---------------------------------------------------
+ 8 3.1 3.0.1 (3.0.1d9)
+ 9 3.1 with Corrigendum 3 3.1.1 (3.1.1)
+ 11 4.0 4.0.0 (4.0.0)
+ 14 4.1.0 4.1.0 (4.1.0)
Note: Recent UTS #10 renames "Tracking Version" to "Revision."
the table file is searched as F<Unicode/Collate/Foo.txt> in C<@INC>.
By default, F<allkeys.txt> (as the filename of DUCET) is used.
+If you will prepare your own table file, any name other than F<allkeys.txt>
+may be better to avoid namespace conflict.
If C<undef> is passed explicitly as the value for this key,
no file is read (but you can define collation elements via C<entry>).
No method will be exported.
+=head1 INSTALL
+
+Though this module can be used without any C<table> file,
+to use this module easily, it is recommended to install a table file
+in the UCA format, by copying it under the directory
+<a place in @INC>/Unicode/Collate.
+
+The most preferable one is "The Default Unicode Collation Element Table",
+available from the Unicode Consortium's website:
+
+ http://www.unicode.org/Public/UCA/
+
+ http://www.unicode.org/Public/UCA/latest/allkeys.txt (latest version)
+
+If DUCET is not installed, it is recommended to copy the file
+from http://www.unicode.org/Public/UCA/latest/allkeys.txt
+to <a place in @INC>/Unicode/Collate/allkeys.txt
+manually.
+
=head1 CAVEATS
=over 4
=back
-=head1 AUTHOR
+=head1 AUTHOR, COPYRIGHT AND LICENSE
-SADAHIRO Tomoyuki <SADAHIRO@cpan.org>
+The Unicode::Collate module for perl was written by SADAHIRO Tomoyuki,
+<SADAHIRO@cpan.org>. This module is Copyright(C) 2001-2005,
+SADAHIRO Tomoyuki. Japan. All rights reserved.
-Copyright(C) 2001-2005, SADAHIRO Tomoyuki. Japan. All rights reserved.
+This module is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
-This module is free software; you can redistribute it
-and/or modify it under the same terms as Perl itself.
+The file Unicode/Collate/allkeys.txt was copied directly
+from http://www.unicode.org/Public/UCA/4.1.0/allkeys.txt (aka DUCET).
+This file is Copyright (c) 1991-2005 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in http://www.unicode.org/copyright.html
=head1 SEE ALSO
Revision history for Perl module Unicode::Collate.
+0.51 Sun May 29 20:21:19 2005
+ - Added the latest DUCET (for Unicode 4.1.0) as Collate/allkeys.txt,
+ which is not required to test this module.
+ Please notice that allkeys.txt will be overwritten if you have had
+ other allkeys.txt already.
+ - Added INSTALL section in POD.
+
0.50 Sun May 8 20:26:39 2005
- Now UCA Revision 14 (based on Unicode 4.1.0).
- Some tests are modified.
-Unicode/Collate version 0.50
+Unicode/Collate version 0.51
===============================
NAME
$result = $Collator->eq($a, $b); # returns true/false
(similarly ->ne, ->lt, ->le, ->gt, ->ge)
-INSTALLATION
+INSTALL
Perl 5.6.1 or later is required.
Perl 5.8.1 or later is recommended.
-To use this module, it is recommended to install a table file
-in the UCA format, by copying it into the directory
-where Unicode/Collate.pm is installed;
-e.g., into perl/lib/Unicode/Collate/ directory
-if you will have perl/lib/Unicode/Collate.pm.
+Though this module can be used without any C<table> file,
+to use this module easily, it is recommended to install a table file
+in the UCA format, by copying it under the directory
+<a place in @INC>/Unicode/Collate.
You can install such a table file by adding it
to "Collate" directory (where "keys.txt" is placed) in this distribution
The most preferable one is "The Default Unicode Collation Element Table",
available from the Unicode Consortium's website:
- http://www.unicode.org/Public/UCA/
+ http://www.unicode.org/Public/UCA/
- http://www.unicode.org/Public/UCA/latest/allkeys.txt (latest version)
+ http://www.unicode.org/Public/UCA/latest/allkeys.txt (latest version)
+
+If DUCET is not installed, it is recommended to copy the file
+from http://www.unicode.org/Public/UCA/latest/allkeys.txt
+to <a place in @INC>/Unicode/Collate/allkeys.txt
+manually.
Though this distribution contains a subset of allkeys.txt, named "keys.txt",
this one is intended only for doing a test of this module
The conformant collation requires Unicode::Normalize (v 0.10 or later)
although Unicode::Collate can be used without Unicode::Normalize.
-COPYRIGHT AND LICENSE
-
-SADAHIRO Tomoyuki <SADAHIRO@cpan.org>
+AUTHOR, COPYRIGHT AND LICENSE
-Copyright(C) 2001-2005, SADAHIRO Tomoyuki. Japan. All rights reserved.
+The Unicode::Collate module for perl was written by SADAHIRO Tomoyuki,
+<SADAHIRO@cpan.org>. This module is Copyright(C) 2001-2005,
+SADAHIRO Tomoyuki. Japan. All rights reserved.
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
+The file Unicode/Collate/allkeys.txt was copied directly
+from http://www.unicode.org/Public/UCA/4.1.0/allkeys.txt (aka DUCET).
+This file is Copyright (c) 1991-2005 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in http://www.unicode.org/copyright.html