|
|
@ -122,30 +122,35 @@ def to_conll09(sentence_entry):
|
|
|
|
for token in sentence_entry["tokens"]:
|
|
|
|
for token in sentence_entry["tokens"]:
|
|
|
|
if token[0] != "w":
|
|
|
|
if token[0] != "w":
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
t_id = token[1]
|
|
|
|
msd = msdm.msd_from_slo(token[4])
|
|
|
|
msd = msdm.msd_from_slo(token[4])
|
|
|
|
fprd = fillpred("todo", "todo")
|
|
|
|
fprd = fillpred("TODO", "todo")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
print(t_id)
|
|
|
|
|
|
|
|
print("msd:")
|
|
|
|
print(msd)
|
|
|
|
print(msd)
|
|
|
|
print(token)
|
|
|
|
print(token)
|
|
|
|
print(sentence_entry["links"])
|
|
|
|
print(sentence_entry["links"])
|
|
|
|
t_id = token[1]
|
|
|
|
"""
|
|
|
|
print(t_id)
|
|
|
|
|
|
|
|
# 1 3 4 5 6 7 8 9 10 11 12 13 14
|
|
|
|
# 1 3 4 5 6 7 8 9 10 11 12 13 14
|
|
|
|
out_str += "{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\n".format(
|
|
|
|
out_str += "{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\n".format(
|
|
|
|
t_id, # id
|
|
|
|
t_id, # id
|
|
|
|
token[2], # form
|
|
|
|
token[2], # form
|
|
|
|
token[3], # lemma
|
|
|
|
token[3], # lemma
|
|
|
|
token[3], # plemma
|
|
|
|
token[3], # plemma
|
|
|
|
"todo", # pos (TODO)
|
|
|
|
msd[0][3], # pos
|
|
|
|
"todo", # ppos (TODO)
|
|
|
|
msd[0][3], # ppos
|
|
|
|
"todo", # feat (TODO)
|
|
|
|
"|".join([msd[0][2]] + [el[4] for el in msd[1]]), # feat
|
|
|
|
"todo", # pfeat (TODO)
|
|
|
|
"|".join([msd[0][2]] + [el[4] for el in msd[1]]), # pfeat
|
|
|
|
sentence_entry["links"][t_id][2], # head
|
|
|
|
sentence_entry["links"][t_id][2], # head
|
|
|
|
sentence_entry["links"][t_id][2], # phead
|
|
|
|
sentence_entry["links"][t_id][2], # phead
|
|
|
|
sentence_entry["links"][t_id][1], # deprel
|
|
|
|
sentence_entry["links"][t_id][0], # deprel
|
|
|
|
sentence_entry["links"][t_id][1], # pdeprel
|
|
|
|
sentence_entry["links"][t_id][0], # pdeprel
|
|
|
|
fprd, # fillpred
|
|
|
|
fprd, # fillpred
|
|
|
|
(token[3] if fprd == "Y" else "_"), # pred
|
|
|
|
(token[3] if fprd == "Y" else "_"), # pred
|
|
|
|
"todo" # apredn...
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
out_str += "\n"
|
|
|
|
out_str += "\n"
|
|
|
|
|
|
|
|
print(out_str)
|
|
|
|
return out_str
|
|
|
|
return out_str
|
|
|
|