def METHOD_NAME(self, root):
    text = root.text
    computed = root.compute_text()
    if text == computed:
        return
    nospace_text = text.replace(' ', '')
    if nospace_text != computed.replace(' ', ''):
        logging.warning('Mismatch of the stored and computed text cannot be solved with '
                        ' ud.AddGoeswithFromText:\n<<%s>>\n<<%s>>', text, computed)
        return
    # Normalize the stored text (double space -> single space)
    text = ' '.join(text.split())
    for node in root.token_descendants:
        nospace_form = node.form.replace(' ', '')
        if text.startswith(node.form):
            text = text[len(node.form):]
            nospace_text = nospace_text[len(nospace_form):]
            if not text or text[0].isspace():
                del node.misc['SpaceAfter']
                text = text.lstrip()
            else:
                node.misc['SpaceAfter'] = 'No'
        elif nospace_text.startswith(nospace_form):
            nospace_text = nospace_text[len(nospace_form):]
            len_raw_form = len(nospace_form)
            while text[:len_raw_form].replace(' ', '') != nospace_form:
                len_raw_form += 1
                assert len_raw_form <= len(text)
            raw_form = text[:len_raw_form]
            text = text[len_raw_form:]
            tokens = raw_form.split(' ')
            node.form = tokens[0]
            if not self.keep_lemma:
                node.lemma = tokens[0].lower()
            del node.misc['SpaceAfter']
            last_node = node
            for token in tokens[1:]:
                lemma = None if self.keep_lemma else token
                child = node.create_child(form=token, lemma=lemma, upos=node.upos,
                                          xpos=node.xpos, deprel='goeswith')
                child.shift_after_node(last_node)
                last_node = child
            if not text or text[0].isspace():
                text = text.lstrip()
            else:
                last_node.misc['SpaceAfter'] = 'No'
        else:
            assert False  # we have checked the whole sentence already
    if text:
        logging.warning('Extra text "%s" in tree %s', text, root)