code: def test_spelling_field():
      text = "rendering shading modeling reactions"
      ana = analysis.StemmingAnalyzer()
      schema = fields.Schema(
          text=fields.TEXT(analyzer=ana, spelling=True)
      )
  
      assert schema["text"].spelling
      assert schema["text"].separate_spelling()
  
      with TempIndex(schema) as ix:
          with ix.writer() as w:
              w.add_document(text=text)
  
          with ix.searcher() as s:
              r = s.reader()
              fieldobj = schema["text"]
              words = [
                  fieldobj.from_bytes(t) for t in r.lexicon("text")
              ]
              assert words == ["model", "reaction", "render", "shade"]
  
              words = [
                  fieldobj.from_bytes(t)
                  for t in r.lexicon("spell_text")
              ]
              assert words == [
                  "modeling",
                  "reactions",
                  "rendering",
                  "shading",
              ]
  
              # suggest() automatically looks in the spell_text field because
              # it calls fieldobj.spelling_fieldname() first
              assert s.suggest("text", "renderink") == ["rendering"]
  
          with ix.writer() as w:
              w.delete_document(0)
  
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 9 for calling a global function with example usage: test_spelling_field() without return types