Пример #1
0
def trans_latin(term): ## Rule and training hybrid transliteration
    if term.lower() in data_dict:
        return data_dict[term.lower()]
    else:
        if decide_acronym(term):
            return read_acronym(term)
        else:
            return return_trans(term) ## Tentative
Пример #2
0
def trans_latin(term):  ## Rule and training hybrid transliteration
    if term.lower() in data_dict:
        return data_dict[term.lower()]
    else:
        if decide_acronym(term):
            return read_acronym(term)
        else:
            return tft(term.lower())  ## Transformer-based
Пример #3
0
def leftword(chunks):
    for i in range(len(chunks)):
        eojeol = chunks[i]
        for j in range(len(eojeol)):
            term = chunks[i][j]
            if real_latin(term):
                chunks[i][j] = read_acronym(term)
            elif not hgtk.checker.is_hangul(term) and term not in puncs:
                chunks[i][j] = ''
    return chunks