projects
/
python-collate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6231314
)
Fix typo, remove unneeded check.
author
Joe Wreschnig
<joe.wreschnig@gmail.com>
Mon, 22 Feb 2010 07:30:57 +0000
(23:30 -0800)
committer
Joe Wreschnig
<joe.wreschnig@gmail.com>
Mon, 22 Feb 2010 07:30:57 +0000
(23:30 -0800)
collate/strings.py
patch
|
blob
|
history
diff --git
a/collate/strings.py
b/collate/strings.py
index
1dffdac
..
5badc8c
100644
(file)
--- a/
collate/strings.py
+++ b/
collate/strings.py
@@
-19,7
+19,7
@@
def sortemes(string, key=lambda s: s):
A sorteme, by analogy with grapheme/morpheme/etc. is an atom of
sort information. This is larger than a word boundry but smaller
than a sentence boundry; roughly, a sorteme boundry occurs between
A sorteme, by analogy with grapheme/morpheme/etc. is an atom of
sort information. This is larger than a word boundry but smaller
than a sentence boundry; roughly, a sorteme boundry occurs between
- letters and numbers, between numbers and numbrs if 'too much'
+ letters and numbers, between numbers and numb
e
rs if 'too much'
punctuation exists in between, between lines.
There is no formal specification for sortemes; the goal of this
punctuation exists in between, between lines.
There is no formal specification for sortemes; the goal of this
@@
-34,7
+34,6
@@
def sortemes(string, key=lambda s: s):
string = unicode(string)
categories = map(unicodedata.category, string)
previous = UNKNOWN
string = unicode(string)
categories = map(unicodedata.category, string)
previous = UNKNOWN
- types = []
def stripends(word):
while word and unicodedata.category(word[0])[0] in "PS":
def stripends(word):
while word and unicodedata.category(word[0])[0] in "PS":
@@
-122,7
+121,7
@@
def sortemes(string, key=lambda s: s):
return [(i, key(w) if w else u'') for i, w in words]
return [(i, key(w) if w else u'') for i, w in words]
-def numeric(orig, invalid=
float('inf')
):
+def numeric(orig, invalid=
INFINITY
):
if not orig:
return invalid
if not orig:
return invalid
@@
-144,12
+143,6
@@
def numeric(orig, invalid=float('inf')):
string = normalize_punc(string)
string = normalize_punc(string)
- # Early out if possible.
- try:
- return float(string) * mult
- except ValueError:
- pass
-
# Otherwise we need to do this the hard way.
def _numeric(string):
total = 0
# Otherwise we need to do this the hard way.
def _numeric(string):
total = 0