def read_stoplist(fname) :
    """
    Read stop words from a text file, and ignore comments after '#'.
    
    The file contains a stop word per line. 
    """
    stoplist = open(fname).read().split()
    stoplist = filter(lambda line : len(line.strip())>0 and line.strip()[0] != '#', stoplist)
    stoplist = map(lambda line : line.split('#')[0].strip(), stoplist)
    return set(stoplist)