code: def create_dictionary(lexicon=None):
      """
      This function is to create a new dictionary used for improving tokenization model for multi-syllable words languages
      such as vi, zh or th. This function takes the lexicon as input and output a dictionary that contains three set:
      words, prefixes and suffixes where prefixes set should contains all the prefixes in the lexicon and similar for suffixes.
      The point of having prefixes/suffixes sets in the  dictionary is just to make it easier to check during data preparation.
  
      :param shorthand - language and dataset, eg: vi_vlsp, zh_gsdsimp
      :param lexicon - set of words used to create dictionary
      :return a dictionary object that contains words and their prefixes and suffixes.
      """
  
      dictionary = {
          "words": set(),
          "prefixes": set(),
          "suffixes": set(),
      }
  
      def add_word(word):
          if word not in dictionary["words"]:
              dictionary["words"].add(word)
              prefix = ""
              suffix = ""
              for i in range(0, len(word) - 1):
                  prefix = prefix + word[i]
                  suffix = word[len(word) - i - 1] + suffix
                  dictionary["prefixes"].add(prefix)
                  dictionary["suffixes"].add(suffix)
  
      for word in lexicon:
          if len(word) > 1:
              add_word(word)
  
      return dictionary
  
imports: from collections import Counter
  from copy import copy
  import json
  import numpy
  import re
  import logging
  import os
  from torch.utils.data import DataLoader
  import stanza.utils.default_paths
  from stanza.models.common.utils import ud_scores, harmonic_mean
  from stanza.models.common.doc import Document
  from stanza.utils.conll import CoNLL
  from stanza.models.common.doc import *
  from stanza.models.tokenization.data import SortedDataset
label_desc: Use image node_id 1 for calling a global function with example usage: create_dictionary(lexicon) and returns: dictionary