a6ec268d9bb6512bffd6b1d752088798fde6ea09
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
))
6 def words(self
, string
):
7 """Split the string into separate words.
9 This split is done using Unicode's definition of whitespace.
13 def wordkeys(self
, string
):
14 return map(self
.key
, self
.words
)