class_docstr: Base class for spelling correction objects. Concrete sub-classes should
  implement the ``_suggestions`` method.
class_docstr_tok: ["Base","class","for","spelling","correction","objects",".","Concrete","sub-classes","should","implement","the","``","_suggestions","``","method","."]
docstr: :param text: the text to check. This word will **not** be added to the
      suggestions, even if it appears in the word graph.
  :param limit: only return up to this many suggestions. If there are not
      enough terms in the field within ``maxdist`` of the given word, the
      returned list will be shorter than this number.
  :param maxdist: the largest edit distance from the given word to look
      at. Values higher than 2 are not very effective or efficient.
  :param prefix: require suggestions to share a prefix of this length
      with the given word. This is often justifiable since most
      misspellings do not involve the first letter of the word. Using a
      prefix dramatically decreases the time it takes to generate the
      list of words.
docstr_tok: [":","param","text",":","the","text","to","check",".","This","word","will","*","*","not","*","*","be","added","to","the","suggestions",",","even","if","it","appears","in","the","word","graph",".",":","param","limit",":","only","return","up","to","this","many","suggestions",".","If","there","are","not","enough","terms","in","the","field","within","``","maxdist","``","of","the","given","word",",","the","returned","list","will","be","shorter","than","this","number",".",":","param","maxdist",":","the","largest","edit","distance","from","the","given","word","to","look","at",".","Values","higher","than","2","are","not","very","effective","or","efficient",".",":","param","prefix",":","require","suggestions","to","share","a","prefix","of","this","length","with","the","given","word",".","This","is","often","justifiable","since","most","misspellings","do","not","involve","the","first","letter","of","the","word",".","Using","a","prefix","dramatically","decreases","the","time","it","takes","to","generate","the","list","of","words","."]
code: def suggest(self, text, limit=5, maxdist=2, prefix=0):
      """
      :param text: the text to check. This word will **not** be added to the
          suggestions, even if it appears in the word graph.
      :param limit: only return up to this many suggestions. If there are not
          enough terms in the field within ``maxdist`` of the given word, the
          returned list will be shorter than this number.
      :param maxdist: the largest edit distance from the given word to look
          at. Values higher than 2 are not very effective or efficient.
      :param prefix: require suggestions to share a prefix of this length
          with the given word. This is often justifiable since most
          misspellings do not involve the first letter of the word. Using a
          prefix dramatically decreases the time it takes to generate the
          list of words.
      """
  
      _suggestions = self._suggestions
  
      heap = []
      for item in _suggestions(text, maxdist, prefix):
          # Note that the *higher* scores (item[0]) are better!
          if len(heap) < limit:
              heappush(heap, item)
          elif item > heap[0]:
              heapreplace(heap, item)
  
      sugs = sorted(heap, key=lambda x: (0 - x[0], x[1]))
      return [sug for _, sug in sugs]
  
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 1 for calling the Corrector obj's underlying member method code with example usage: obj.suggest(text, limit, maxdist, prefix) and returns: unknown