projects
/
python-collate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7dc546d
)
Minor tweaks for better numeric-following-split-strings.
author
Joe Wreschnig
<joe.wreschnig@gmail.com>
Thu, 18 Feb 2010 08:04:17 +0000
(
00:04
-0800)
committer
Joe Wreschnig
<joe.wreschnig@gmail.com>
Thu, 18 Feb 2010 08:04:17 +0000
(
00:04
-0800)
collate/_strings.py
patch
|
blob
|
history
diff --git
a/collate/_strings.py
b/collate/_strings.py
index
dde1739
..
aed2ba7
100644
(file)
--- a/
collate/_strings.py
+++ b/
collate/_strings.py
@@
-72,7
+72,7
@@
def sortemes(string):
# If we read two strings separated by weird punctuation,
# pretend the punctuation isn't there.
if (this_mode == previous_mode == LETTER
# If we read two strings separated by weird punctuation,
# pretend the punctuation isn't there.
if (this_mode == previous_mode == LETTER
- and
prev_category[0] == "P"
+ and
(category[0] == "P" or prev_category[0] == "P")
and words):
words[-1] += u" " + string[start:last+1]
else:
and words):
words[-1] += u" " + string[start:last+1]
else:
@@
-88,8
+88,9
@@
def sortemes(string):
last = None
if category[0] in "LN":
last = i
last = None
if category[0] in "LN":
last = i
+ this_mode = mode
if start is not None and last is not None:
if start is not None and last is not None:
- if this_mode == previous_mode == LETTER and words:
+ if this_mode ==
LETTER and
previous_mode == LETTER and words:
words[-1] += u" " + string[start:last+1]
else:
if this_mode == NUMBER and previous_mode == LETTER and words:
words[-1] += u" " + string[start:last+1]
else:
if this_mode == NUMBER and previous_mode == LETTER and words: