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