from typing import Union
import difflib


def find_similar_word(word : str, template_word : Union[list,set]) -> str :
    """
    Find similar word in template_word using difflib
    Return the most similar word if there are no close matches return word.
    """
    tmp = difflib.get_close_matches(word, template_word)
    if len(tmp) == 0 : return word
    else : return tmp[0]