code: def test_correct_spell_field():
      ana = analysis.StemmingAnalyzer()
      schema = fields.Schema(
          text=fields.TEXT(analyzer=ana, spelling=True)
      )
      with TempIndex(schema) as ix:
          with ix.writer() as w:
              w.add_document(
                  text="rendering shading modeling reactions"
              )
  
          with ix.searcher() as s:
              text = s.schema["text"]
              spell_text = s.schema["spell_text"]
  
              r = s.reader()
              words = [text.from_bytes(t) for t in r.lexicon("text")]
              assert words == ["model", "reaction", "render", "shade"]
  
              words = [
                  spell_text.from_bytes(t)
                  for t in r.lexicon("spell_text")
              ]
              assert words == [
                  "modeling",
                  "reactions",
                  "rendering",
                  "shading",
              ]
  
              qp = QueryParser("text", s.schema)
              qtext = "renderink"
              q = qp.parse(qtext, s.schema)
  
              r = s.search(q)
              assert len(r) == 0
  
              c = s.correct_query(q, qtext)
              assert c.string == "rendering"
              assert c.query == query.Term("text", "rendering")
  
              hf = highlight.HtmlFormatter(classname="c")
              assert (
                  c.format_string(hf)
                  == '<strong class="c term0">rendering</strong>'
              )
  
imports: from __future__ import with_statement
  import gzip
  from whoosh import analysis, fields, highlight, query, spelling
  from whoosh.compat import u
  from whoosh.qparser import QueryParser
  from whoosh.support.levenshtein import levenshtein
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 10 for calling a global function with example usage: test_correct_spell_field() without return types