code: def add_r_ending(stem: str) -> str:
      
      s_stem = s.syllabify_ssp(stem.lower())
      n_stem = len(s_stem)
      last_syllable = Syllable(s_stem[-1], VOWELS, CONSONANTS)
      return "".join(s_stem[:-1]) + add_r_ending_to_syllable(last_syllable.text, n_stem == 1)
docs: Adds an -r ending to an Old Norse noun.
  
      >>> add_r_ending("arm")
      'armr'
  
      >>> add_r_ending("ás")
      'áss'
  
      >>> add_r_ending("stól")
      'stóll'
  
      >>> add_r_ending("jökul")
      'jökull'
  
      >>> add_r_ending("stein")
      'steinn'
  
      >>> add_r_ending('mikil')
      'mikill'
  
      >>> add_r_ending('sæl')
      'sæll'
  
      >>> add_r_ending('litil')
      'litill'
  
      >>> add_r_ending('vænn')
      'vænn'
  
      >>> add_r_ending('lauss')
      'lauss'
  
      >>> add_r_ending("vin")
      'vinr'
  
      >>> add_r_ending("sel")
      'selr'
  
      >>> add_r_ending('fagr')
      'fagr'
  
      >>> add_r_ending('vitr')
      'vitr'
  
      >>> add_r_ending('vetr')
      'vetr'
  
      >>> add_r_ending('akr')
      'akr'
  
      >>> add_r_ending('Björn')
      'björn'
  
      >>> add_r_ending('þurs')
      'þurs'
  
      >>> add_r_ending('karl')
      'karl'
  
      >>> add_r_ending('hrafn')
      'hrafn'
  
      :param stem:
      :return: