projects
/
python-collate.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Collator.lstripwords: Strip words off the start and append to the end.
[python-collate.git]
/
collate
/
icu
/
__init__.py
diff --git
a/collate/icu/__init__.py
b/collate/icu/__init__.py
index
e7dfe2d
..
6d27a6f
100644
(file)
--- a/
collate/icu/__init__.py
+++ b/
collate/icu/__init__.py
@@
-41,10
+41,8
@@
class Collator(collate._abcollator.Collator):
def words(self, string):
"""Split the string along word boundries."""
def words(self, string):
"""Split the string along word boundries."""
- if isinstance(string, str):
- string = string.decode(self.encoding)
- words = self._breaker.words(string)
- return [w for w in words if not w.isspace()]
+ string = self.unicode(string)
+ return self._breaker.words(string)
def key(self, string):
"""Sort key for a string.
def key(self, string):
"""Sort key for a string.
@@
-53,7
+51,6
@@
class Collator(collate._abcollator.Collator):
instance according to the 'encoding' attribute of the
Collator.
"""
instance according to the 'encoding' attribute of the
Collator.
"""
- if isinstance(string, str):
- string = string.decode(self.encoding, 'replace')
+ string = self.unicode(string)
return self._collator.key(string)
return self._collator.key(string)