extract and extractOne fail if choices contains null strings #3

Closed
ciferkey opened this Issue Jul 21, 2011 · 0 comments

2 participants

@ciferkey

Extract and extractOne fail if choices contains either an empty string or a string of only whitespace. For example:

process.extract('string1', ['', 'string', ''])

and

process.extract('string1', [' ', 'string', ' '])

will traceback:

    len_ratio = float(max(len(p1),len(p2)))/min(len(p1),len(p2))

ZeroDivisionError: float division by zero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment