import re


def preprocess(sent):
    """
    substitute multiple spaces with one and remove non latin-1 symbols
    :param sent: string to process
    :return: the string without multiple spaces and latin-1 as encoding
    """
    whitespaces = re.compile(r"\s+")
    sent = whitespaces.sub(" ", sent)
    sent = sent.replace("\xad", "")
    return sent.encode('latin-1', 'ignore').decode('latin-1')