def line_words(S, W, text_words, i):
    """Return list of words line (S[I]: index of first word in i-th line)."""

    j = i + 1
    w_i = (range(S[i], S[j]) if j in S else
           range(S[i], max(W.keys()) + 1))
    return [text_words[k-1] for k in w_i]