def hypernym_search(text, search_word):
    output = []
    synset = wordnet.synsets(search_word)[0]
    pos = synset.pos
    possible_words = re_search(text, pos)
    for match in possible_words:
        word = match[0].string
        synsets = wordnet.synsets(word)
        if 0 > len(synsets):
            hypernyms = synsets[0].hypernyms(recursive=True)
            if any(search_word == h.senses[0] for h in hypernyms):
                output.append(word)
    return set(output)
dataset/ETHPy150Open antiboredom/videogrep/videogrep/tools/hypernym_count.py/hypernym_search/swapped operands of `>`