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

Error on finding similar strings #36

Closed
nijel opened this issue Apr 18, 2012 · 2 comments
Closed

Error on finding similar strings #36

nijel opened this issue Apr 18, 2012 · 2 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@nijel
Copy link
Member

nijel commented Apr 18, 2012

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, _callback_args, *_callback_kwargs)

File "/var/lib/django/l10n/weblate/trans/views.py", line 848, in get_similar
similar = Unit.objects.similar(unit)

File "/var/lib/django/l10n/weblate/trans/managers.py", line 252, in similar
terms = [kw for kw, score in searcher.key_terms_from_text('source', unit.source, numterms = 10) if not kw in IGNORE_SIMILAR]

File "/usr/lib/python2.7/dist-packages/whoosh/searching.py", line 471, in key_terms_from_text
return expander.expanded_terms(numterms, normalize=normalize)

File "/usr/lib/python2.7/dist-packages/whoosh/classify.py", line 177, in expanded_terms
norm = model.normalizer(maxweight, self.top_total)

File "/usr/lib/python2.7/dist-packages/whoosh/classify.py", line 58, in normalizer
return (maxweight * log((1.0 + f) / f) + log(1.0 + f)) / log(2.0)

ZeroDivisionError: float division by zero

@nijel
Copy link
Member Author

nijel commented Apr 18, 2012

The text was Appliance (Weblate website translation).

@ghost ghost assigned nijel Apr 22, 2012
@nijel
Copy link
Member Author

nijel commented May 4, 2012

Forwarded to Whoosh https://bitbucket.org/mchaput/whoosh/issue/256/zerodivisionerror-float-division-by-zero as this IMHO should not happen.

@nijel nijel closed this as completed May 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

No branches or pull requests

1 participant