code: def __init__(
      self,
      g2p_type: Union[None, str],
      non_linguistic_symbols: Union[Path, str, Iterable[str]] = None,
      space_symbol: str = "<space>",
      remove_non_linguistic_symbols: bool = False,
  ):
      assert check_argument_types()
      if g2p_type is None:
          self.g2p = split_by_space
      elif g2p_type == "g2p_en":
          self.g2p = G2p_en(no_space=False)
      elif g2p_type == "g2p_en_no_space":
          self.g2p = G2p_en(no_space=True)
      elif g2p_type == "pyopenjtalk":
          self.g2p = pyopenjtalk_g2p
      elif g2p_type == "pyopenjtalk_kana":
          self.g2p = pyopenjtalk_g2p_kana
      elif g2p_type == "pyopenjtalk_accent":
          self.g2p = pyopenjtalk_g2p_accent
      elif g2p_type == "pyopenjtalk_accent_with_pause":
          self.g2p = pyopenjtalk_g2p_accent_with_pause
      elif g2p_type == "pyopenjtalk_prosody":
          self.g2p = pyopenjtalk_g2p_prosody
      elif g2p_type == "pypinyin_g2p":
          self.g2p = pypinyin_g2p
      elif g2p_type == "pypinyin_g2p_phone":
          self.g2p = pypinyin_g2p_phone
      elif g2p_type == "pypinyin_g2p_phone_without_prosody":
          self.g2p = pypinyin_g2p_phone_without_prosody
      elif g2p_type == "espeak_ng_arabic":
          self.g2p = Phonemizer(
              language="ar",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_german":
          self.g2p = Phonemizer(
              language="de",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_french":
          self.g2p = Phonemizer(
              language="fr-fr",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_spanish":
          self.g2p = Phonemizer(
              language="es",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_russian":
          self.g2p = Phonemizer(
              language="ru",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_greek":
          self.g2p = Phonemizer(
              language="el",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_finnish":
          self.g2p = Phonemizer(
              language="fi",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_hungarian":
          self.g2p = Phonemizer(
              language="hu",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_dutch":
          self.g2p = Phonemizer(
              language="nl",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_hindi":
          self.g2p = Phonemizer(
              language="hi",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_italian":
          self.g2p = Phonemizer(
              language="it",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "espeak_ng_polish":
          self.g2p = Phonemizer(
              language="pl",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
          )
      elif g2p_type == "g2pk":
          self.g2p = G2pk(no_space=False)
      elif g2p_type == "g2pk_no_space":
          self.g2p = G2pk(no_space=True)
      elif g2p_type == "g2pk_explicit_space":
          self.g2p = G2pk(
              explicit_space=True, space_symbol=space_symbol
          )
      elif g2p_type == "espeak_ng_english_us_vits":
          # VITS official implementation-like processing
          # Reference: https://github.com/jaywalnut310/vits
          self.g2p = Phonemizer(
              language="en-us",
              backend="espeak",
              with_stress=True,
              preserve_punctuation=True,
              strip=True,
              word_separator=" ",
              phone_separator="",
              split_by_single_token=True,
          )
      elif g2p_type == "korean_jaso":
          self.g2p = Jaso(space_symbol=space_symbol, no_space=False)
      elif g2p_type == "korean_jaso_no_space":
          self.g2p = Jaso(no_space=True)
      elif g2p_type == "g2p_is":
          self.g2p = IsG2p()
      elif g2p_type == "g2p_is_north":
          self.g2p = IsG2p(dialect="north")
      else:
          raise NotImplementedError(
              f"Not supported: g2p_type={g2p_type}"
          )
  
      self.g2p_type = g2p_type
      self.space_symbol = space_symbol
      if non_linguistic_symbols is None:
          self.non_linguistic_symbols = set()
      elif isinstance(non_linguistic_symbols, (Path, str)):
          non_linguistic_symbols = Path(non_linguistic_symbols)
          try:
              with non_linguistic_symbols.open(
                  "r", encoding="utf-8"
              ) as f:
                  self.non_linguistic_symbols = set(
                      line.rstrip() for line in f
                  )
          except FileNotFoundError:
              warnings.warn(f"{non_linguistic_symbols} doesn't exist.")
              self.non_linguistic_symbols = set()
      else:
          self.non_linguistic_symbols = set(non_linguistic_symbols)
      self.remove_non_linguistic_symbols = remove_non_linguistic_symbols
  
imports: import logging
  import re
  import warnings
  from pathlib import Path
  from typing import Iterable, List, Optional, Union
  import g2p_en
  import jamo
  from packaging.version import parse
  from typeguard import check_argument_types
  from espnet2.text.abs_tokenizer import AbsTokenizer
label_desc: Use image node_id 1 to create a new PhonemeTokenizer object from inherited base classes: AbsTokenizer with example: obj = PhonemeTokenizer(g2p_type, non_linguistic_symbols, space_symbol, remove_non_linguistic_symbols)