def find_word_boundaries(string):
    """
    Given a string, such as "my lights are off", return a tuple::

        0: a list containing all word boundaries in tuples
        (start(inclusive), end(exclusive)):
        [(0, 2), (3, 9), (10, 13), (14, 17)]
        1: a set of all start positions: set[(0, 3, 10, 14)]
        2: a set of all end positions: set[(2, 9, 13, 17)]

    """
    start, end, last_end = 0, 0, -1
    boundaries = []
    while end != -1:
        end = string.find(" ", start)
        if end != -1:
            boundaries.append((start, end))
            last_end = end
        start = last_end + 1
    start, end = start, len(string)
    if end > start:
        boundaries.append((start, end))
    if len(boundaries) > 0:
        starts, ends = zip(*boundaries)
        starts, ends = set(starts), set(ends)
    else:
        starts, ends = set(), set()
    return boundaries, starts, ends