bb0dcd83bf2087c9162e2b0f5508f64ce4213880
[python-collate.git] / collate / icu / __init__.py
1 import collate.icu._ucol
2 import collate._abcollator
3
4 NAME = "ICU"
5
6 class Collator(collate._abcollator.Collator):
7 def __init__(self, locale, encoding):
8 self._collator = collate.icu._ucol.Collator(locale)
9 self.locale = self._collator.locale
10
11 def key(self, string):
12 return self._collator.key(string)
13
14 def cmp(self, string1, string2):
15 return self._collator.cmp(string1, string2)