def METHOD_NAME(self, filename):
    if filename is None:
        return
    dir_name = os.path.dirname(filename)
    if not os.path.exists(dir_name):
        os.makedirs(dir_name)
    with open(file=filename, mode="w", encoding="utf-8") as fo:
        for word in self._t2i.keys():
            fo.write("{}\n".format(word))