1Unicode/Collate version 0.52 2=============================== 3 4NAME 5 6 Unicode::Collate - Unicode Collation Algorithm 7 8SYNOPSIS 9 10 use Unicode::Collate; 11 12 #construct 13 $Collator = Unicode::Collate->new(%tailoring); 14 15 #sort 16 @sorted = $Collator->sort(@not_sorted); 17 18 #compare 19 $result = $Collator->cmp($a, $b); # returns 1, 0, or -1. 20 $result = $Collator->eq($a, $b); # returns true/false 21 (similarly ->ne, ->lt, ->le, ->gt, ->ge) 22 23INSTALL 24 25Perl 5.6.1 or later is required. 26Perl 5.8.1 or later is recommended. 27 28Though this module can be used without any C<table> file, 29to use this module easily, it is recommended to install a table file 30in the UCA format, by copying it under the directory 31<a place in @INC>/Unicode/Collate. 32 33You can install such a table file by adding it 34to "Collate" directory (where "keys.txt" is placed) in this distribution 35before executing Makefile.PL. 36 37The most preferable one is "The Default Unicode Collation Element Table" 38(aka DUCET), available from the Unicode Consortium's website: 39 40 http://www.unicode.org/Public/UCA/ 41 42 http://www.unicode.org/Public/UCA/latest/allkeys.txt (latest version) 43 44If DUCET is not installed, it is recommended to copy the file 45from http://www.unicode.org/Public/UCA/latest/allkeys.txt 46to <a place in @INC>/Unicode/Collate/allkeys.txt 47manually. 48 49Though this distribution contains a subset of allkeys.txt, named "keys.txt", 50this one is intended only for doing a test of this module 51and practically useless for any other purpose. 52 53To install this module type the following: 54 55 perl Makefile.PL 56 make 57 make test 58 make install 59 60(!! XSUB for Unicode::Collate is an EXPERIMENTAL support !!) 61If you have a C compiler and want to use XSUB edition, 62type the following (!! "enableXS" must run before "Makefile.PL" !!): 63 64 perl enableXS 65 perl Makefile.PL 66 make 67 make test 68 make install 69 70If you decide to install pure Perl (i.e. non-XS) edition after trying 71to build XSUB, type the following: 72 73 make clean 74 perl disableXS 75 perl Makefile.PL 76 make 77 make test 78 make install 79 80DEPENDENCIES 81 82 The conformant collation requires Unicode::Normalize (v 0.10 or later) 83 although Unicode::Collate can be used without Unicode::Normalize. 84 85AUTHOR, COPYRIGHT AND LICENSE 86 87The Unicode::Collate module for perl was written by SADAHIRO Tomoyuki, 88<SADAHIRO@cpan.org>. This module is Copyright(C) 2001-2005, 89SADAHIRO Tomoyuki. Japan. All rights reserved. 90 91This module is free software; you can redistribute it and/or 92modify it under the same terms as Perl itself. 93 94The file Unicode/Collate/allkeys.txt was copied directly 95from http://www.unicode.org/Public/UCA/4.1.0/allkeys.txt 96This file is Copyright (c) 1991-2005 Unicode, Inc. All rights reserved. 97Distributed under the Terms of Use in http://www.unicode.org/copyright.html 98