class_docstr: Trie vocabulary used in spelling correction algorithms
  
  Args:
      data_dir: path to the directory where the built trie will be stored. Relative paths are interpreted as
          relative to pipeline's data directory
      dictionary_name: logical name of the dictionary
      raw_dictionary_path: path to the source file with the list of words
  
  Attributes:
      dict_name: logical name of the dictionary
      alphabet: set of all the characters used in this dictionary
      words_set: set of all the words
      words_trie: trie structure of all the words
class_docstr_tok: ["Trie","vocabulary","used","in","spelling","correction","algorithms","Args",":","data_dir",":","path","to","the","directory","where","the","built","trie","will","be","stored",".","Relative","paths","are","interpreted","as","relative","to","pipeline","'s","data","directory","dictionary_name",":","logical","name","of","the","dictionary","raw_dictionary_path",":","path","to","the","source","file","with","the","list","of","words","Attributes",":","dict_name",":","logical","name","of","the","dictionary","alphabet",":","set","of","all","the","characters","used","in","this","dictionary","words_set",":","set","of","all","the","words","words_trie",":","trie","structure","of","all","the","words"]
code: def __init__(
      self,
      data_dir: [Path, str] = "",
      *args,
      dictionary_name: str = "dictionary",
      **kwargs,
  ):
      data_dir = expand_path(data_dir) / dictionary_name
  
      alphabet_path = data_dir / "alphabet.pkl"
      words_path = data_dir / "words.pkl"
      words_trie_path = data_dir / "words_trie.pkl"
  
      if not is_done(data_dir):
          log.debug(
              "Trying to build a dictionary in {}".format(data_dir)
          )
          if data_dir.is_dir():
              shutil.rmtree(str(data_dir))
          data_dir.mkdir(parents=True)
  
          words = self._get_source(data_dir, *args, **kwargs)
          words = {self._normalize(word) for word in words}
  
          alphabet = {c for w in words for c in w}
          alphabet.remove("⟬")
          alphabet.remove("⟭")
  
          save_pickle(alphabet, alphabet_path)
          save_pickle(words, words_path)
  
          words_trie = defaultdict(set)
          for word in words:
              for i in range(len(word)):
                  words_trie[word[:i]].add(word[: i + 1])
              words_trie[word] = set()
          words_trie = {k: sorted(v) for k, v in words_trie.items()}
  
          save_pickle(words_trie, words_trie_path)
  
          mark_done(data_dir)
          log.debug("built")
      else:
          log.debug("Loading a dictionary from {}".format(data_dir))
  
      self.alphabet = load_pickle(alphabet_path)
      self.words_set = load_pickle(words_path)
      self.words_trie = load_pickle(words_trie_path)
  
imports: import shutil
  from collections import defaultdict
  from logging import getLogger
  from pathlib import Path
  import requests
  from lxml import html
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.file import load_pickle, save_pickle
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.data.utils import is_done, mark_done
label_desc: Use image node_id 1 to create a new StaticDictionary object  with example: obj = StaticDictionary(data_dir)