Exemplo n.º 1
0
def end2end():
    stdout = sys.stdout
    sys.stdout = open(os.devnull, 'wb')
    d = runtrainingset(runprocess("sicstus --noinfo --nologo --goal restore('HPSG/hpsg'),train,halt."))
    sys.stdout = stdout
    return id3.csvstring2data(d).id3()
Exemplo n.º 2
0
def getinstances(trees, tagsize=2):
    sw = stringwriter()
    savetrainingdata(trees, tagsize=tagsize, out=sw)
    return id3.csvstring2data(sw.txt, separator="\t")