code: def _load_data(path):
      
      path = os.path.abspath(path)
      if not os.path.isdir(path):
          raise InitializationError('Directory not found: {0}'.format(path))
      wordlists = {}
      for file_name in os.listdir(path):
          if os.path.splitext(file_name)[1] != '.txt':
              continue
          file_path = os.path.join(path, file_name)
          name = os.path.splitext(os.path.split(file_path)[1])[0]
          try:
              with codecs.open(file_path, encoding='utf-8') as file:
                  wordlists[name] = _load_wordlist(name, file)
          except OSError as ex:
              raise InitializationError('Failed to read {}: {}'.format(file_path, ex))
      config = _load_config(os.path.join(path, 'config.json'))
      return (config, wordlists)
docs: Loads data from a directory.
      Returns tuple (config_dict, wordlists).
      Raises Exception on failure (e.g. if data is corrupted).