docs: def string_component_transform_factory(alg):
      """
      Create a function to either transform a string or convert to a number.
  
      Parameters
      ----------
      alg : ns enum
          Indicate how to format the *str*.
  
      Returns
      -------
      func : callable
          A function to be used as the *component_transform* argument to
          *parse_string_factory*.
  
      See Also
      --------
      parse_string_factory
  
      """
      # Shortcuts.
      use_locale = alg & ns.LOCALEALPHA
      dumb = alg & NS_DUMB
      group_letters = (alg & ns.GROUPLETTERS) or (use_locale and dumb)
      nan_val = float("+inf") if alg & ns.NANLAST else float("-inf")
  
      # Build the chain of functions to execute in order.
      func_chain = []
      if group_letters:
          func_chain.append(groupletters)
      if use_locale:
          func_chain.append(get_strxfrm())
      kwargs = {"key": chain_functions(func_chain)} if func_chain else {}
  
      # Return the correct chained functions.
      if alg & ns.FLOAT:
          # noinspection PyTypeChecker
          kwargs["nan"] = nan_val
          return partial(fast_float, **kwargs)
      else:
          return partial(fast_int, **kwargs)