def shorten_rule(rule):
    """
    If possible, this method removes redundant parts of the given rule.

    >>> shorten_rule((['ukr_itself_place', 'ukr_itself_place'],
                     [4.5, 1.5], [True, True], 'voiced'))
    (['ukr_itself_place'], [1.5], [True], 'voiced')

    Keyword arguments:
    rule: A tuple(list(str), list(float), list(bool), str)
          that represents a sorted rule.

    Returns:
    A tuple(list(str), list(float), list(bool), str) that is either identical
    to `rule` or a pruned version of it.
    """
    if len(rule) < 2:
        return rule

    remove_indices = []
    (features, thresholds, decisions, class_name) = rule

    for i in range(1, len(features)):
        if features[i] != features[i - 1]:
            continue
        if decisions[i] and decisions[i - 1]:  # less-than-or-equal-to
            remove_indices.append(i)
        elif (not decisions[i]) and (not decisions[i - 1]):  # bigger than
            remove_indices.append(i - 1)

    lists = [features, thresholds, decisions]
    for idx in range(len(lists)):
        lists[idx] = [x for i, x in enumerate(lists[idx])
                      if i not in remove_indices]

    return (*lists, class_name)