code: def write_concordance_from_string(text: str, name: str) -> None:
      
      list_of_lists = build_concordance(text)  # type: List[List[str]]
      user_data_rel = '~/cltk_data/user_data'  # type: str
      user_data = os.path.expanduser(user_data_rel)  # type: str
      if not os.path.isdir(user_data):
          os.makedirs(user_data)
      file_path = os.path.join(user_data, 'concordance_' + name + '.txt')  # type: str
      concordance_output = ''  # type: str
      for word_list in list_of_lists:
          for line in word_list:
              concordance_output += line + '\n'
      try:
          with open(file_path, 'w') as open_file:
              open_file.write(concordance_output)
              logger.info("Wrote concordance to '%s'.", file_path)
      except IOError as io_error:
          logger.error("Failed to write concordance to '%s'. Error: %s", file_path, io_error)
docs: A reworkinng of write_concordance_from_file(). Refactor these.