def substring_set(w, l):
    """Returns all substrings of a word w of length l

    Parameters
    ----------
    w: list
        List of characters representing a word

    l: int
        Length of substrings to generate

    Returns
    -------
    set
        A set of substrings of the specified length
    """
    #return all unique substrings of a word w of length l from 1 letter to the entire word
    substrings = set([])
    for i in range(len(w)):
        sub = w[i:(i+l)]
        if len(sub) < l:
            continue
        substrings.update(['.'.join(sub)])
    return substrings