Пример #1
0
def onDecodingFinish(data, output):
    align_fp = ao_fp if ao_fp is not None else sys.stderr
    for src_id, (inp, out) in sorted(output.items(), key=lambda x:x[0]):
        if type(out) == tuple:
            out, align = out
            AlignmentVisualizer.print([align], src_id, [inp], [out], SRC, TRG, fp=align_fp)
        print(TRG.str_rpr(out))
Пример #2
0
def onSingleUpdate(ctr, src, trg):
    align_fp = ao_fp if ao_fp is not None else sys.stderr
    if args.verbose:
        print_result(ctr, trg, TRG, src, SRC, sys.stderr)
    print(TRG.str_rpr(trg.y[0]))
    if trg.a is not None:
        AlignmentVisualizer.print(trg.a, ctr, src, trg.y, SRC, TRG, fp=align_fp)