Commit cb1e3c1f authored by Alexis Nasr's avatar Alexis Nasr
Browse files

modification de conll2mcf : les labels complexes sont transformés en labels simples

parent 4a37ce59
......@@ -7,6 +7,15 @@ if len(sys.argv) < 3 :
print('usage:', sys.argv[0], 'conllFile mcdFile')
exit(1)
def simplifyLabel(label):
simpleLabel = []
for i in range(len(label)):
if not label[i] == ':' :
simpleLabel.append(label[i])
else :
break
return ''.join(simpleLabel)
conlluFilename = sys.argv[1]
mcdFilename = sys.argv[2]
......@@ -42,7 +51,8 @@ for ligne in conlluFile:
w.setFeat('X1', tokens[4])
w.setFeat('MORPHO', tokens[5])
w.setFeat('GOV', int(tokens[6]) - index)
w.setFeat('LABEL', tokens[7])
label = simplifyLabel(tokens[7])
w.setFeat('LABEL', label)
w.setFeat('X2', tokens[8])
w.setFeat('X3', tokens[9])
w.setFeat('EOS', '0')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment