def METHOD_NAME(fs_dict, words, append_eos=True):
    ids = []
    for i, word in enumerate(words):
        idx = fs_dict.index(word)
        ids.append(idx)
    if append_eos:
        ids.append(fs_dict.eos_index)
    return ids