code: def thaiword_to_num(word: str) -> int:
      
      if not word:
          return None
  
      tokens = []
      if isinstance(word, str):
          tokens = _TOKENIZER.word_tokenize(word)
      elif isinstance(word, Iterable):
          for w in word:
              tokens.extend(_TOKENIZER.word_tokenize(w))
  
      res = []
      for tok in tokens:
          if tok in _THAIWORD_NUMS_UNITS:
              res.append(tok)
          else:
              m = _NU_PAT.fullmatch(tok)
              if m:
                  res.extend([t for t in m.groups() if t])  # ตัด None ทิ้ง
              else:
                  pass  # should not be here
  
      return _thaiword_to_num(res)
docs: Converts a Thai number spellout word to actual number value
  
      :param str word: a Thai number spellout
      :return: number