-This module is unsuitable for real-world use at this time.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
pycollate - Collation algorithms for Python
-------------------------------------------
- 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 a
-"best" backend is chosen by default.
+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
-------
-icu/_ucol.pyx:
+icu/_icu.pyx:
Copyright (c) 2004 Zope Corporation and Contributors.
All Rights Reserved.