Skip to content
Snippets Groups Projects
Commit 3ec2551f authored by Franck Dary's avatar Franck Dary
Browse files

getActionSets now ignore second parts of labels

parent 9f9367ea
Branches
No related tags found
No related merge requests found
...@@ -57,12 +57,17 @@ if __name__ == "__main__" : ...@@ -57,12 +57,17 @@ if __name__ == "__main__" :
elif nameCol == "LABEL" : elif nameCol == "LABEL" :
output = open("parser.as", 'w', encoding='utf-8') output = open("parser.as", 'w', encoding='utf-8')
print("REDUCE", file=output) print("REDUCE", file=output)
labels = set()
for line in open(colFile, "r", encoding='utf-8') : for line in open(colFile, "r", encoding='utf-8') :
striped = line.strip() striped = line.strip()
if len(striped) == 0 or striped == "root" or striped == "_" : if len(striped) == 0 or striped == "root" or striped == "_" :
continue continue
print("LEFT " + striped, file=output) label = striped.split(':')[0]
print("RIGHT " + striped, file=output) 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("EOS", file=output)
print("Default : SHIFT", file=output) print("Default : SHIFT", file=output)
output.close() output.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment