- def cmp(self, a, b):
- """Return negative if a < b, zero if a == b, positive if a > b.
-
- If strs rather than unicodes are passed in, they are first
- decoded according to the 'encoding' attribute of the Collator.
- """
+ def words(self, string, sep=re.compile(r"\W+", re.UNICODE)):
+ """Split the string into separate words."""
+ if isinstance(string, str):
+ string = string.decode(self.encoding, 'replace')
+ return re.split(sep, string)