code: def normalize_middle_high_german(
      text: str,
      to_lower_all: bool = True,
      to_lower_beginning: bool = False,
      alpha_conv: bool = True,
      punct: bool = True,
      ascii: bool = False,
  ):
      """Normalize input string.
  
      >>> from cltk.alphabet import gmh
      >>> from cltk.languages.example_texts import get_example_text
      >>> gmh.normalize_middle_high_german(get_example_text("gmh"))[:50]
      'uns ist in alten\\nmæren wunders vil geseit\\nvon hele'
  
      :param text:
      :param to_lower_beginning:
      :param to_lower_all: convert whole text to lowercase
      :param alpha_conv: convert alphabet to canonical form
      :param punct: remove punctuation
      :param ascii: returns ascii form
      :return: normalized text
      """
  
      if to_lower_all:
          text = text.lower()
      if to_lower_beginning:
          text = text[0].lower() + text[1:]
          text = re.sub(
              r"(?<=[\.\?\!]\s)(\w)", lambda x: x.group(1).lower(), text
          )
      if alpha_conv:
          text = (
              text.replace("ē", "ê")
              .replace("ī", "î")
              .replace("ā", "â")
              .replace("ō", "ô")
              .replace("ū", "û")
          )
          text = text.replace("ae", "æ").replace("oe", "œ")
      if punct:
          text = re.sub(r"[\.\";\,\:\[\]\(\)!&?‘]", "", text)
      if ascii:
          text = unicodedata.normalize("NFKD", text).encode(
              "ASCII", "ignore"
          )  # Encode into ASCII, returns a bytestring
          text = text.decode("utf-8")  # Convert back to string
      return text
  
label_desc: Use image node_id 1 for calling a global function with example usage: normalize_middle_high_german(text, to_lower_all, to_lower_beginning, alpha_conv, punct, ascii) and returns: text