docs: def spacing(text):
      """
      Perform paranoid text spacing on text.
      """
      if len(text) <= 1 or not ANY_CJK.search(text):
          return text
  
      new_text = text
  
      # TODO: refactoring
      matched = CONVERT_TO_FULLWIDTH_CJK_SYMBOLS_CJK.search(new_text)
      while matched:
          start, end = matched.span()
          new_text = ''.join((new_text[:start + 1], convert_to_fullwidth(new_text[start + 1:end - 1]), new_text[end - 1:]))
          matched = CONVERT_TO_FULLWIDTH_CJK_SYMBOLS_CJK.search(new_text)
  
      matched = CONVERT_TO_FULLWIDTH_CJK_SYMBOLS.search(new_text)
      while matched:
          start, end = matched.span()
          new_text = ''.join((new_text[:start + 1].strip(), convert_to_fullwidth(new_text[start + 1:end]), new_text[end:].strip()))
          matched = CONVERT_TO_FULLWIDTH_CJK_SYMBOLS.search(new_text)
  
      new_text = DOTS_CJK.sub(r'\1 \2', new_text)
      new_text = FIX_CJK_COLON_ANS.sub(r'\1：\2', new_text)
  
      new_text = CJK_QUOTE.sub(r'\1 \2', new_text)
      new_text = QUOTE_CJK.sub(r'\1 \2', new_text)
      new_text = FIX_QUOTE_ANY_QUOTE.sub(r'\1\3\5', new_text)
  
      new_text = CJK_SINGLE_QUOTE_BUT_POSSESSIVE.sub(r'\1 \2', new_text)
      new_text = SINGLE_QUOTE_CJK.sub(r'\1 \2', new_text)
      new_text = FIX_POSSESSIVE_SINGLE_QUOTE.sub(r"\1's", new_text)
  
      new_text = HASH_ANS_CJK_HASH.sub(r'\1 \2\3\4 \5', new_text)
      new_text = CJK_HASH.sub(r'\1 \2', new_text)
      new_text = HASH_CJK.sub(r'\1 \3', new_text)
  
      new_text = CJK_OPERATOR_ANS.sub(r'\1 \2 \3', new_text)
      new_text = ANS_OPERATOR_CJK.sub(r'\1 \2 \3', new_text)
  
      new_text = FIX_SLASH_AS.sub(r'\1\2', new_text)
      new_text = FIX_SLASH_AS_SLASH.sub(r'\1\2\3', new_text)
  
      new_text = CJK_LEFT_BRACKET.sub(r'\1 \2', new_text)
      new_text = RIGHT_BRACKET_CJK.sub(r'\1 \2', new_text)
      new_text = FIX_LEFT_BRACKET_ANY_RIGHT_BRACKET.sub(r'\1\3\5', new_text)
      new_text = ANS_CJK_LEFT_BRACKET_ANY_RIGHT_BRACKET.sub(r'\1 \2\3\4', new_text)
      new_text = LEFT_BRACKET_ANY_RIGHT_BRACKET_ANS_CJK.sub(r'\1\2\3 \4', new_text)
  
      new_text = AN_LEFT_BRACKET.sub(r'\1 \2', new_text)
      new_text = RIGHT_BRACKET_AN.sub(r'\1 \2', new_text)
  
      new_text = CJK_ANS.sub(r'\1 \2', new_text)
      new_text = ANS_CJK.sub(r'\1 \2', new_text)
  
      new_text = S_A.sub(r'\1 \2', new_text)
  
      new_text = MIDDLE_DOT.sub('・', new_text)
  
      return new_text.strip()