def stringify(sentence, vocab):
    """
    Given a numericalized sentence, fetch the correct word from the vocab and
    return it along with token indices in the new sentence

    Example:
    sentence :
        "1 2 3"
    vocab :
        {
            1 : "Get"
            2 : "me"
            3 : "water"
        }

    return value :
        [
            ["Get", [0, 3]],
            ["me", [4, 6]],
            ["water", [7, 12]],
        ]
    """
    return_val = []
    length_so_far = -1
    for idx in sentence.strip().split(" "):
        beg_index = length_so_far + 1
        word = vocab[int(idx)]
        end_index = beg_index + len(word)
        length_so_far = end_index
        return_val.append([word, [beg_index, end_index]])
    return return_val