code: def test_substitution():
      mf = analysis.RegexTokenizer(
          r"\S+"
      ) | analysis.SubstitutionFilter("-", "")
      assert [t.text for t in mf(u("one-two th-re-ee four"))] == [
          "onetwo",
          "threee",
          "four",
      ]
  
      mf = analysis.RegexTokenizer(
          r"\S+"
      ) | analysis.SubstitutionFilter("([^=]*)=(.*)", r"\2=\1")
      assert [t.text for t in mf(u("a=b c=d ef"))] == [
          "b=a",
          "d=c",
          "ef",
      ]
  
imports: from __future__ import with_statement
  import pytest
  from whoosh import analysis, fields, qparser
  from whoosh.compat import b, u, unichr
  from whoosh.compat import dumps
  from whoosh.filedb.filestore import RamStorage
label_desc: Use image node_id 19 for calling a global function with example usage: test_substitution() without return types