import re


def uniq_words(file, min_len):
    """
    Given a file or filehandle, return a set of the unique words
    over a given minimum length
    """
    words = set()
    fh = open(file) if type(file) == str else file

    for line in fh:
        for word in line.lower().split():
            word = re.sub('[^a-zA-Z0-9]', '', word)
            if len(word) >= min_len:
                words.add(word)

    return words