code: def cut(self, chars: List) -> List:
      words = []
      idx = 0
      while idx < len(chars):
          matched = False
          for i in range(self.window_size, 0, -1):
              cand = chars[idx : idx + i]
              if cand in self.dict:
                  words.append(cand)
                  matched = True
                  break
          if not matched:
              i = 1
              words.append(chars[idx])
          idx += i
      return words
  
imports: import collections
  import io
  import pickle
  import unicodedata
  from typing import List, Union
label_desc: Use image node_id 2 for calling the WSSPTokenizer obj's underlying member method code with example usage: obj.cut(chars) and returns: words