import re


def get_space_normalized_segment(segment):
    """Remove leading/trailing as well as multiple spaces from a string.

    :param str segment: a segment (sentence)
    :return: a string with no leading/trailing spaces and only containing single whitespaces
    :rtype: str
    """
    return re.sub(r'\s{2,}', ' ', segment).strip()