ICU backend; uses Pyrex, based on zope.ucol.
[python-collate.git] / collate / icu / __init__.py
diff --git a/collate/icu/__init__.py b/collate/icu/__init__.py
new file mode 100644 (file)
index 0000000..16ef1e6
--- /dev/null
@@ -0,0 +1,12 @@
+import collate.icu._ucol
+import collate._abcollator
+
+class Collator(collate._abcollator.Collator):
+    def __init__(self, locale):
+       self._collator = collate.icu._ucol.Collator(locale)
+
+    def key(self, string):
+       return self._collator.key(string)
+
+    def cmp(self, string1, string2):
+       return self._collator.cmp(string1, string2)