Esempio n. 1
0
def getCompleteDefinitionsForWord(targetWord):
    defs = shinmeikai.getDefsOfWord(targetWord, conf)
    sortedDefs = sortDefinitions(defs)
    optimallySelectedDefs = removeOverflowDefinitions(sortedDefs)
    formatedDef = defListToString(optimallySelectedDefs)
    if conf.addFuriganaToDef:
        formatedDef = mecab.reading(formatedDef)
    completeDefinitions = correctSpacing(formatedDef)
    return completeDefinitions
Esempio n. 2
0
def test():
    defs = shinmeikai.getDefsOfWord(sys.argv[1], conf)
    #print(defs)
    sortedDefs = sortDefinitions(defs)
    #print(sortedDefs)
    optimallySelectedDefs = removeOverflowDefinitions(sortedDefs)
    #print(optimallySelectedDefs)
    formatedDef = defListToString(optimallySelectedDefs)
    #print(formatedDef)
    if conf.addFuriganaToDef:
        formatedDef = mecab.reading(formatedDef)
    #print(formatedDef)
    return formatedDef