- change = {}
- for t in tokens:
- authors = Tag.objects.filter(category='author', name__iregex=match_word_re(t))
- if len(authors) > 0:
- continue
-
- 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
-
- for frm, to in change.items():
- query = query.replace(frm, to)
-