a6ec268d9bb6512bffd6b1d752088798fde6ea09
[python-collate.git] / collate / _abcollator.py
1 class Collator(object):
2 def cmp(self, string1, string2):
3 """Return negative if a < b, zero if a == b, positive if a > b."""
4 return cmp(self.key(string1), self.key(string2))
5
6 def words(self, string):
7 """Split the string into separate words.
8
9 This split is done using Unicode's definition of whitespace.
10 """
11 return string.split()
12
13 def wordkeys(self, string):
14 return map(self.key, self.words)