def clean_phonological_groups(groups, liaison_positions, liaison_property):
    """Clean phonological groups so their liaison property is consistently set
    according to the the liaison positions

    :param groups: Phonological groups to be cleaned
    :param liaison_positions: Positions of the liaisons
    :param liaison_property: The liaison type (synaeresis or synalepha)
    :return: Cleaned phonological groups
    :rtype: dict
    """
    clean_groups = []
    for idx, group in enumerate(groups):
        if liaison_property in group:
            clean_groups.append({
                **group, liaison_property: bool(liaison_positions[idx])
            })
        else:
            clean_groups.append(group)
    return clean_groups