Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Levenshtein exception when mixing unicode and strings #2

Closed
Glench opened this issue Jun 6, 2012 · 0 comments
Closed

Levenshtein exception when mixing unicode and strings #2

Glench opened this issue Jun 6, 2012 · 0 comments

Comments

@Glench
Copy link
Contributor

Glench commented Jun 6, 2012

Not sure if there's anything this library should do about this, but when you add as such you get an exception:

>>> f = FuzzySet()
>>> f.add(u'balls')
>>> f['balls']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/glen/.virtualenvs/temp/lib/python2.7/site-packages/fuzzyset/__init__.py", line 49, in __getitem__
    results = self.__get(value, i)
  File "/Users/glen/.virtualenvs/temp/lib/python2.7/site-packages/fuzzyset/__init__.py", line 74, in __get
    for _, matched in results[:50]]
  File "/Users/glen/.virtualenvs/temp/lib/python2.7/site-packages/fuzzyset/__init__.py", line 88, in _distance
    distance = Levenshtein.distance(str1, str2)
TypeError: distance expected two Strings or two Unicodes
@axiak axiak closed this as completed Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants