code: def test_add_reader_spelling():
      # Test whether add_spell_word() items get copied over in a merge
  
      # Because b is stemming and spelled, it will use add_spell_word()
      ana = analysis.StemmingAnalyzer()
      schema = fields.Schema(
          a=fields.TEXT(analyzer=ana),
          b=fields.TEXT(analyzer=ana, spelling=True),
      )
  
      with TempIndex(schema, "addreadersp") as ix:
          with ix.writer() as w:
              w.add_document(
                  a="rendering modeling", b="rendering modeling"
              )
              w.add_document(a="flying rolling", b="flying rolling")
  
          with ix.writer() as w:
              w.add_document(a="writing eyeing", b="writing eyeing")
              w.add_document(
                  a="undoing indicating", b="undoing indicating"
              )
              w.optimize = True
  
          with ix.reader() as r:
              sws = list(r.lexicon("spell_b"))
              assert sws == [
                  b"eyeing",
                  b"flying",
                  b"indicating",
                  b"modeling",
                  b"rendering",
                  b"rolling",
                  b"undoing",
                  b"writing",
              ]
  
              assert list(r.terms_within("a", "undoink", 1)) == []
              assert list(r.terms_within("b", "undoink", 1)) == [
                  "undoing"
              ]
  
imports: from __future__ import with_statement
  import random, time, threading
  import pytest
  from whoosh import analysis, fields, query, writing
  from whoosh.compat import b, u, xrange, text_type
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempIndex
label_desc: Use image node_id 14 for calling a global function with example usage: test_add_reader_spelling() without return types