Пример #1
0
def eurosense2stifflike(inf, outf, head, babel2wn_map):
    pipeline = add_head(filter_py, add_zstd(inf), head)
    pipeline = (mk_eurosense2stifflike_pipeline(pipeline, babel2wn_map)
                | python[munge_py, "eurosense-add-anchor-positions", "-",
                         outf])
    print(pipeline)
    pipeline(retcode=[-13, 0], stderr=sys.stderr)
Пример #2
0
def stiff2unified(inf, outf, keyout, head, input_fmt):
    pipeline = (add_head(filter_py, add_zstd(inf), head)
                | python[munge_py, "stiff-select-wn", "--wn", "qf2", "-", "-"]
                | python[filter_py, "tok-span-dom", "-", "-"]
                | python[munge_py, "lemma-to-synset", "-", "-"]
                | python[munge_py, "stiff-to-unified", "--input-fmt",
                         input_fmt, "-", "-"]
                | python[munge_py, "unified-split", "-", outf, keyout])
    pipeline(retcode=[-13, 0], stderr=sys.stderr)
Пример #3
0
def eurosense2unified(inf, outf, keyout, head, babel2wn_map):
    """
    Convert from the Eurosense format to the Unified format so that Eurosense
    tagged data can be compared with STIFF.
    """
    pipeline = add_head(filter_py, add_zstd(inf), head)
    pipeline = (mk_eurosense2stifflike_pipeline(pipeline, babel2wn_map)
                | python[munge_py, "eurosense-to-unified", "-", "-"]
                | python[munge_py, "unified-split", "-", outf, keyout])
    pipeline(retcode=[-13, 0], stderr=sys.stderr)