<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tokenize_middle_high_german_words(text):
 """Tokenizes MHG text"""


    assert isinstance(text, str)
    # As far as I know, hyphens were never used for compounds, so the tokenizer treats all hyphens as line-breaks
    text = re.sub(r'-\n',r'-', text)
    text = re.sub(r'\n', r' ', text)
    text = re.sub(r'(?<=.)(?=[\.\";\,\:\[\]\(\)!&?])',r' ', text)
    text = re.sub(r'(?<=[\.\";\,\:\[\]\(\)!&?])(?=.)',r' ', text)
    text = re.sub(r'\s+',r' ', text)
    text = str.split(text)

    return text