code: def _stem_helper(word, rem_umlaut=True):
      """rem_umlat: Remove umlaut from text"""
  
      # Define R1 and R2 regions
  
      # R1 is defined as the region after the first consonant followed by a vowel
  
      try:
          R1 = (
              list(
                  re.finditer(
                      r"[aëeiouäöüâêîôûæœ][bdghfcjklmnspqrtvwz]", word
                  )
              )[0].start()
              + 2
          )
      except:
          R1 = len(word)
  
      # R2 is defined as the region within R1 after the first consonant followed by a vowel
  
      try:
          R2 = (
              list(
                  re.finditer(
                      r"[aëeiouäöüâêîôûæœ][bdghfcjklmnspqrtvwz]",
                      word[R1:],
                  )
              )[0].start()
              + 2
              + R1
          )
      except:
          R2 = len(word)
  
      # Make sure the index of R1 is at least 3.
  
      if R1 < 3:
          try:
              R1 = (
                  list(
                      re.finditer(
                          r"[aëeiouäöüâêîôûæœ][bdghfcjklmnspqrtvwz]",
                          word[1:],
                      )
                  )[0].start()
                  + 2
              )
          except:
              R1 = len(word)
  
      if rem_umlaut:
          word = _remove_umlaut(word)
  
      word = word[:R1] + re.sub(
          r"(wes|wen|est|ern|em|en|er|es|eȥ(?=[klmrt])s|(?=[lr])n|e)$",
          "",
          word[R1:],
      )
      word = word[:R1] + re.sub(
          r"(est|er|en|re|in|iu|(?=.{3})st,word[R1:])$", "", word[R1:]
      )
      word = word[:R2] + re.sub(
          r"(lich?.?.|keit|inc|isch?.?.)$", "", word[R2:]
      )
  
      return word
  
file_path: cltk/src/cltk/stem/gmh.py
imports: import re
  from typing import Dict
  from cltk.alphabet.gmh import normalize_middle_high_german
  from cltk.stops.gmh import STOPS
  from cltk.tokenizers.gmh import MiddleHighGermanWordTokenizer
label_desc: Use image node_id 2 for calling a global function with example usage: _stem_helper(word, rem_umlaut) and returns: word