def custom_lemmas(tab_file, lang: str): """ This function reads a custom tab file (see: http://compling.hss.ntu.edu.sg/omw/) containing mappings of lemmas in the given language. :param tab_file: Tab file as a file or file-like object :param str lang: abbreviation of language (i.e. *eng*, *tha*). """ return wordnet.custom_lemmas(tab_file, lang)
def add_omw_wikt(): for lang, code in [("fin", "qwf"), ("cmn", "qwc")]: wordnet.custom_lemmas( open(get_data_path("wn-wikt-{}.tab".format(lang))), lang=code )
def custom_lemmas(tab_file, lang): return wordnet.custom_lemmas(tab_file, lang)
def fix_cmn(): wordnet.custom_lemmas(open(get_data_path("wn-data-cmn-fixed.tab")), lang="cmn")