code: def to_ipa(word):
      delimit = ""
      tokenize = False
      chao = True
      glottal = True
      nosuper = False
      phonemic = False
      eight = False
      output_ortho = False
  
      compound = ""
      ortho = ""
      dialect = "n"
      ortho += word
      word = word.strip(string.punctuation).lower()
      # if tokenize==true:
      # call this routine for each substring and re-concatenate
      if (tokenize and "-" in word) or (tokenize and "_" in word):
          substrings = re.split(r"(_|-)", word)
          values = substrings[::2]
          delimiters = substrings[1::2] + [""]
          ipa = [
              convert(
                  x,
                  dialect,
                  chao,
                  eight,
                  nosuper,
                  glottal,
                  phonemic,
                  delimit,
              ).strip()
              for x in values
          ]
          seq = "".join(v + d for v, d in zip(ipa, delimiters))
      else:
          seq = convert(
              word,
              dialect,
              chao,
              eight,
              nosuper,
              glottal,
              phonemic,
              delimit,
          ).strip()
      # concatenate
  
      compound = compound + seq
  
      # entire line has been parsed
      if ortho == "":
          pass
      else:
          ortho = ortho.strip()
          # print orthography?
          if output_ortho:
              print(ortho, output_ortho, sep="", end="")
          print(compound)
      return compound
  
file_path: underthesea/examples/text_normalize/tools/vphone.py
imports: from __future__ import absolute_import
  import sys, re, io, string, argparse
  from os.path import join, dirname
  from types import SimpleNamespace
  from underthesea.utils.vietnamese_ipa import vietnamese_sort_key
  from vphone_rules import *
label_desc: Use image node_id 3 for calling a global function with example usage: to_ipa(word) and returns: compound