code: def stem_helper(word, rem_umlaut = True):
  	
  	
  	#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
docs: rem_umlat: Remove umlaut from text