code: def stem_word(word):
      """
      Based on https://drupal.org/project/ukstemmer and ported to Python https://github.com/Amice13/ukr_stemmer
      """
      word = _preprocess(word)
      if not re.search("[аеиоуюяіїє]", word):
          return word
  
      p = re.search(_RVRE, word)
      start = word[0 : p.span()[1]]
      suffix = word[p.span()[1] :]
  
      # Step 1
      updated, suffix = _update_suffix(suffix, _PERFECTIVE_GROUND, "")
      if not updated:
          _, suffix = _update_suffix(suffix, _REFLEXIVE, "")
          updated, suffix = _update_suffix(suffix, _ADJECTIVE, "")
          if updated:
              updated, suffix = _update_suffix(suffix, _PARTICIPLE, "")
          else:
              updated, suffix = _update_suffix(suffix, _VERB, "")
              if not updated:
                  _, suffix = _update_suffix(suffix, _NOUN, "")
      # Step 2
      updated, suffix = _update_suffix(suffix, "и$", "")
  
      # Step 3
      if re.search(_DERIVATIONAL, suffix):
          updated, suffix = _update_suffix(suffix, "ость$", "")
  
      # Step 4
      updated, suffix = _update_suffix(suffix, "ь$", "")
      if updated:
          _, suffix = _update_suffix(suffix, "ейше?$", "")
          _, suffix = _update_suffix(suffix, "нн$", "н")
  
      return start + suffix
  
imports: import re
label_desc: Use image node_id 1 for calling a global function with example usage: stem_word(word) and returns: unknown, word