@classmethod
def from_filename(cls, filename):
    """Creates a Thesaurus object from the given filename, which should
        contain the WordNet wn_s.pl file.

        >>> t = Thesaurus.from_filename("wn_s.pl")
        >>> t.synonyms("hail")
        ['acclaim', 'come', 'herald']
        """
    f = open(filename, 'rb')
    try:
        return cls.from_file(f)
    finally:
        f.close()
