Calculate sortemes using simply alnum splitting rather than word breaks. Faster and...
[python-collate.git] / README.txt
1 This module is unsuitable for real-world use at this time.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 pycollate - Collation algorithms for Python
41 -------------------------------------------
42
43 pycollate is an interface to various collation algorithms for Python.
44
45 Supported backends:
46 - icu - Based on the IBM ICU toolkit and Jim Fulton's zope.ucol.
47 - syslocale - Native OS collation routines.
48 - codepoint - Raw Unicode codepoint comparison
49
50 The different backends have varying features and behaviors; which one
51 is best depends on your goals. A specific backend can be used, or a
52 "best" backend is chosen by default.
53
54 pycollate also provides tools to perform word-wise and numeric sorts.
55
56 pycollate, as with all Unicode collation tools, is a work in progress.
57
58 Example
59 -------
60 import collate
61 strings = file("contents.txt").read().decode("utf-8").splitlines()
62 strings.sort(key=collate.key)
63 # Equivalently but slower,
64 strings.sort(cmp=collate.cmp)
65
66 License
67 -------
68
69 icu/_ucol.pyx:
70
71 Copyright (c) 2004 Zope Corporation and Contributors.
72 All Rights Reserved.
73
74 This software is subject to the provisions of the Zope Public License,
75 Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
76 THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
77 WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
78 WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
79 FOR A PARTICULAR PURPOSE.
80
81 All else:
82
83 Copyright 2010 Joe Wreschnig
84
85 Permission is hereby granted, free of charge, to any person obtaining a copy
86 of this software and associated documentation files (the "Software"), to deal
87 in the Software without restriction, including without limitation the rights
88 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
89 copies of the Software, and to permit persons to whom the Software is
90 furnished to do so, subject to the following conditions:
91
92 The above copyright notice and this permission notice shall be included in
93 all copies or substantial portions of the Software.
94
95 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
96 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
97 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
98 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
99 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
100 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
101 THE SOFTWARE.