From 3ec2551f99930858f0b8b2aa11c8971c1dce4f7c Mon Sep 17 00:00:00 2001 From: Franck Dary <franck.dary@lis-lab.fr> Date: Tue, 15 Oct 2019 13:56:54 +0200 Subject: [PATCH] getActionSets now ignore second parts of labels --- UD_any/data/getActionSets.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/UD_any/data/getActionSets.py b/UD_any/data/getActionSets.py index 57666e8..5e7be2a 100755 --- a/UD_any/data/getActionSets.py +++ b/UD_any/data/getActionSets.py @@ -57,12 +57,17 @@ if __name__ == "__main__" : elif nameCol == "LABEL" : output = open("parser.as", 'w', encoding='utf-8') print("REDUCE", file=output) + labels = set() for line in open(colFile, "r", encoding='utf-8') : striped = line.strip() if len(striped) == 0 or striped == "root" or striped == "_" : continue - print("LEFT " + striped, file=output) - print("RIGHT " + striped, file=output) + label = striped.split(':')[0] + if label not in labels : + labels.add(striped) + for label in labels : + print("LEFT " + label, file=output) + print("RIGHT " + label, file=output) print("EOS", file=output) print("Default : SHIFT", file=output) output.close() -- GitLab