import re


def anagram_filterer(words, sol_anagram):
    """Filters out those words that are not anagrams of sol_anagram

    Args: 
      words: answer candidates returned by W2V model
      sol_anagram : word that other words must be an anagram of

    """

    keep = []
    for word in words:
        word = re.sub('_', '', word)
        if(sorted(word) == sorted(sol_anagram)):
            keep.append(word)

    return keep