code: def countthai(text: str, ignore_chars: str = _DEFAULT_IGNORE_CHARS) -> float:
      
      if not text or not isinstance(text, str):
          return 0
  
      if not ignore_chars:
          ignore_chars = ""
  
      num_thai = 0
      num_ignore = 0
  
      for ch in text:
          if ch in ignore_chars:
              num_ignore += 1
          elif isthaichar(ch):
              num_thai += 1
  
      num_count = len(text) - num_ignore
  
      return (num_thai / num_count) * 100
docs: :param str text: input text
      :return: float, proportion of characters in the text that is Thai character