import re


def _untag_sentence(s):
    """Removes all tags in the sentence, returning the original sentence
    without Medscan annotations.

    Parameters
    ----------
    s : str
        The tagged sentence

    Returns
    -------
    untagged_sentence : str
        Sentence with tags and annotations stripped out
    """
    p = 'ID{[0-9,]+=([^}]+)}'
    s = re.sub(p, '\\1', s)

    s = re.sub('CONTEXT{[^}]+}', '', s)
    s = re.sub('GLOSSARY{[^}]+}', '', s)
    return s