Fix typo, remove unneeded check.
[python-collate.git] / collate / strings.py
index 1dffdac..5badc8c 100644 (file)
@@ -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