'Get the topmost hypernyms of this synset in WordNet.'

def root_hypernyms(self):

    result = []
    seen = set()
    todo = [self]
    while todo:
        next_synset = todo.pop()
        if (next_synset not in seen):
            seen.add(next_synset)
            next_hypernyms = (next_synset.hypernyms() + next_synset.instance_hypernyms())
            if (not next_hypernyms):
                result.append(next_synset)
            else:
                todo.extend(next_hypernyms)
    return result
