X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5bbe4f1c1ad5a8b27d9804cfd6f8f15f9c53d2b8..ff7fdef651969934b0883aece903f0ae289e55fd:/apps/search/views.py diff --git a/apps/search/views.py b/apps/search/views.py index 881815da1..ec8275b91 100644 --- a/apps/search/views.py +++ b/apps/search/views.py @@ -17,10 +17,10 @@ from lucene import StringReader from suggest.forms import PublishingSuggestForm from time import sleep import re -import enchant +#import enchant import json -dictionary = enchant.Dict('pl_PL') +#dictionary = enchant.Dict('en_US') def match_word_re(word): @@ -37,13 +37,14 @@ def did_you_mean(query, tokens): if len(authors) > 0: continue - if not dictionary.check(t): - try: - change_to = dictionary.suggest(t)[0].lower() - if change_to != t.lower(): - change[t] = change_to - except IndexError: - pass + if False: + if not dictionary.check(t): + try: + change_to = dictionary.suggest(t)[0].lower() + if change_to != t.lower(): + change[t] = change_to + except IndexError: + pass if change == {}: return None