code: def segment(text: str, custom_dict: Trie = None) -> List[str]:
      
      if not text or not isinstance(text, str):
          return []
  
      if not custom_dict:
          custom_dict = DEFAULT_DICT_TRIE
  
      return list(_onecut(text, custom_dict))
docs: Dictionary-based word segmentation, using maximal matching algorithm and Thai Character Cluster
      :param str text: text to be tokenized to words
      :return: list of words, tokenized from the text