X-Git-Url: https://git.korewanetadesu.com/?p=python-collate.git;a=blobdiff_plain;f=README.txt;h=eeb68b019061703f927a3921d917880ccb2b30d1;hp=299bc82a05dc9902e5a13a106fba3f733aa2f5d2;hb=b278dcabc282c5faa070a72c2e7fd915597ccd00;hpb=29f1f7e12a4ca6100b00dc0d32e84f82f530bcb4 diff --git a/README.txt b/README.txt index 299bc82..eeb68b0 100644 --- a/README.txt +++ b/README.txt @@ -1,42 +1,3 @@ -This module is unsuitable for real-world use at this time. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pycollate - Collation algorithms for Python ------------------------------------------- @@ -44,50 +5,44 @@ pycollate is an interface to various collation algorithms for Python. Supported backends: - icu - Based on the IBM ICU toolkit and Jim Fulton's zope.ucol. -- uca - Native Python UCA implementation, based on James Tauber's. - syslocale - Native OS collation routines. +- codepoint - Raw Unicode codepoint comparison -The different backends have varying features and behaviors; which one -is best depends on your goals. A specific backend can be used, or the -default one (usually ICU or UCA) can also be used. +If available, you'll probably want to use the ICU backend. If it's not +available, syslocale should work on most Python installations. A +specific backend can be used, or a "best" backend is chosen by +default. pycollate also provides tools to perform word-wise and numeric sorts. pycollate, as with all Unicode collation tools, is a work in progress. +Installing +---------- +$ sudo apt-get install python-pyrex libicu-dev +$ ./setup.py build +$ sudo ./setup.py install + Example ------- import collate -strings = file("contents.txt").read().decode("utf-8").splitlines() +strings = open("contents.txt").read().decode("utf-8").splitlines() strings.sort(key=collate.key) -# Equivalently but slower, -strings.sort(cmp=collate.cmp) License ------- -uca/__init__.py: - -Copyright (c) 2006 James Tauber - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +icu/_icu.pyx: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +Copyright (c) 2004 Zope Corporation and Contributors. +All Rights Reserved. +This software is subject to the provisions of the Zope Public License, +Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +FOR A PARTICULAR PURPOSE. All else: