import re


def _clean_sent(sent):
    """
    This preprocessing function takes in a sentence object, grabs just the
    actual sentence, and runs three regex substitutions to clean up the
    sentence for querying.
    """
    s = re.sub(r'\s([\.,!?\)\]])', r'\1', sent.get_sentence().lower())
    s = re.sub(r'([\(\[])\s', r'\1', s)
    s = re.sub(r'(\s’[\ss])', r'’', s, re.UNICODE)
    return s