def __loadEntityFromClp(self, similar_form):
        entity = Entity()
        for id in plp.plp_rec(similar_form.encode(default_encoding())):
            entity.base = plp.plp_bform(id).decode(default_encoding())
            entity.label = plp.plp_label(id).decode(default_encoding())
            for form in plp.plp_forms(id):
                entity.forms.append(form.decode(default_encoding()))
            break
        entity.prefix = self.__getPrefix(entity.base, entity.forms)

        return entity
예제 #2
0
파일: draw.py 프로젝트: xorver/word_graph
def get_base_word(word):
    try:
        id = plp.plp_rec(word.encode('UTF-8'))
        return plp.plp_bform(id[0]).decode('UTF-8')
    except:
        return "undefined"