Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed old versions of validate_string() and remove_ponctuation() ke…

…pt from previous commits
  • Loading branch information...
commit 2c953c809171e49a9aacb699a0636192783dfc74 1 parent 32a9695
@medecau medecau authored
Showing with 2 additions and 15 deletions.
  1. +2 −2 fuzzywuzzy/benchmarks.py
  2. +0 −13 fuzzywuzzy/utils.py
View
4 fuzzywuzzy/benchmarks.py
@@ -25,12 +25,12 @@
for s in cirque_strings:
print 'Test for string: "%s"' % s
- print 'Old: %f' % round(timeit('utils.remove_punctuationold(\'%s\')' % s, "import utils",number=iterations),4)
+ # print 'Old: %f' % round(timeit('utils.remove_punctuationold(\'%s\')' % s, "import utils",number=iterations),4)
print 'New: %f' % round(timeit('utils.remove_punctuation(\'%s\')' % s, "import utils",number=iterations),4)
print
for s in choices:
print 'Test for string: "%s"' % s
- print 'Old: %f' % round(timeit('utils.validate_stringold(\'%s\')' % s, "import utils",number=iterations*10),4)
+ # print 'Old: %f' % round(timeit('utils.validate_stringold(\'%s\')' % s, "import utils",number=iterations*10),4)
print 'New: %f' % round(timeit('utils.validate_string(\'%s\')' % s, "import utils",number=iterations*10),4)
View
13 fuzzywuzzy/utils.py
@@ -26,22 +26,9 @@ def asciidammit(x):
x = unicode(x)
return asciidammit(x)
-def remove_punctuationold(s):
- if s is None: return s
- s = s.replace(","," ").replace("."," ").replace("-"," ").replace(":"," ")
- return s
-
def remove_punctuation(s):
return string.translate(s, punctuation_table)
-def validate_stringold(s):
- if s is None: return False
- try:
- if len(s) == 0: return False
- except:
- return False
- return True
-
def validate_string(s):
try:
if len(s)>0:
Please sign in to comment.
Something went wrong with that request. Please try again.