projects
/
python-collate.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
_strings: Numeric string extraction routines.
[python-collate.git]
/
collate
/
_abcollator.py
diff --git
a/collate/_abcollator.py
b/collate/_abcollator.py
index
71f5f54
..
a6ec268
100644
(file)
--- a/
collate/_abcollator.py
+++ b/
collate/_abcollator.py
@@
-2,3
+2,13
@@
class Collator(object):
def cmp(self, string1, string2):
"""Return negative if a < b, zero if a == b, positive if a > b."""
return cmp(self.key(string1), self.key(string2))
def cmp(self, string1, string2):
"""Return negative if a < b, zero if a == b, positive if a > b."""
return cmp(self.key(string1), self.key(string2))
+
+ def words(self, string):
+ """Split the string into separate words.
+
+ This split is done using Unicode's definition of whitespace.
+ """
+ return string.split()
+
+ def wordkeys(self, string):
+ return map(self.key, self.words)