ready to go

This commit is contained in:
2019-02-28 08:20:21 +01:00
parent b4c7ac5427
commit 60ac569f40
6 changed files with 22 additions and 10 deletions

View File

@@ -61,6 +61,7 @@ def get_dep_rel(token):
par = Parser()
OUTPATH.mkdir(exist_ok=True)
print("Start generating .josn files.")
for infile in [x for x in INPATH.iterdir() if x.is_file()]:
origfile = get_origfile(infile)
orig_dict = par.parse_tei(origfile)
@@ -98,3 +99,5 @@ for infile in [x for x in INPATH.iterdir() if x.is_file()]:
outfile = (OUTPATH / infile.name).with_suffix(".json")
with outfile.open("w") as fp:
json.dump(outdata, fp)
print("SRL relations written to: ", outfile)
print("Finished generating .json files.")

View File

@@ -32,9 +32,10 @@ print("parsing kres")
# kres_file = "../data/kres_example/F0019343.xml.parsed.xml"
OUTDIR.mkdir(exist_ok=True)
for kres_file in [x for x in INDIR.iterdir() if x.is_file()]:
infiles = [x for x in INDIR.iterdir() if x.is_file()]
for i, kres_file in enumerate(infiles):
print("Processing file: " + str(kres_file))
print("Processing file ({}/{}): {}".format(i+1, len(infiles), str(kres_file)))
res_dict = par.parse_tei(kres_file)
kres_out_str = ""

View File

@@ -1,6 +1,6 @@
[tools]
kres_orig = ../data/kres_example
kres_tsv = ../data/kres_example_tsv
kres_srl = ../data/kres_example_srl
kres_json = ../data/kres_example_json
kres_tsv = ../data/kres_out/1_tsv
kres_srl = ../data/kres_out/_srl
kres_json = ../data/kres_out/final_json
debug = False