From 576fe7bace3061ef949762141afbb3eb2ec31ecd Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Sun, 21 Feb 2010 23:30:57 -0800 Subject: [PATCH] Fix typo, remove unneeded check. --- collate/strings.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/collate/strings.py b/collate/strings.py index 1dffdac..5badc8c 100644 --- 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 - letters and numbers, between numbers and numbrs if 'too much' + letters and numbers, between numbers and numbers if 'too much' 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 - types = [] 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] -def numeric(orig, invalid=float('inf')): +def numeric(orig, invalid=INFINITY): if not orig: return invalid @@ -144,12 +143,6 @@ def numeric(orig, invalid=float('inf')): 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 -- 2.20.1