class_docstr: Base class for objects that correct words in a user query.
class_docstr_tok: ["Base","class","for","objects","that","correct","words","in","a","user","query","."]
docstr: Returns a :class:`Correction` object representing the corrected
  form of the given query.
  
  :param q: the original :class:`whoosh.query.Query` tree to be
      corrected.
  :param qstring: the original user query. This may be None if the
      original query string is not available, in which case the
      ``Correction.string`` attribute will also be None.
  :rtype: :class:`Correction`
docstr_tok: ["Returns","a",":","class",":","`","Correction","`","object","representing","the","corrected","form","of","the","given","query",".",":","param","q",":","the","original",":","class",":","`","whoosh.query.Query","`","tree","to","be","corrected",".",":","param","qstring",":","the","original","user","query",".","This","may","be","None","if","the","original","query","string","is","not","available",",","in","which","case","the","``","Correction.string","``","attribute","will","also","be","None",".",":","rtype",":",":","class",":","`","Correction","`"]
code: def correct_query(self, q, qstring):
      """
      Returns a :class:`Correction` object representing the corrected
      form of the given query.
  
      :param q: the original :class:`whoosh.query.Query` tree to be
          corrected.
      :param qstring: the original user query. This may be None if the
          original query string is not available, in which case the
          ``Correction.string`` attribute will also be None.
      :rtype: :class:`Correction`
      """
  
      raise NotImplementedError
  
imports: from bisect import bisect_left
  from heapq import heappush, heapreplace
  from whoosh import highlight
  from whoosh.compat import iteritems, xrange
label_desc: Use image node_id 2 for calling the QueryCorrector obj's underlying member method code with example usage: obj.correct_query(q, qstring) without return types