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

Made the transitionsSet generation script to output expected state name

parent c3171319
Branches
Tags
No related merge requests found
...@@ -36,6 +36,7 @@ columns: all_no_test.conllu $(MCD) ...@@ -36,6 +36,7 @@ columns: all_no_test.conllu $(MCD)
cat all_no_test.conllu | sed '/^#/ d' | cut -f$$number | sort --unique > col_$$number.txt ; \ cat all_no_test.conllu | sed '/^#/ d' | cut -f$$number | sort --unique > col_$$number.txt ; \
done done
./getTransitionSets.py $(MCD) col_*\.txt ./getTransitionSets.py $(MCD) col_*\.txt
cat tagger.ts parser.ts > taggerparser.ts
texts: texts:
./getRawText.py $(CONLL2TXT) $(TRAIN_FILES) $(DEV_FILEs) $(TEST_FILES) ./getRawText.py $(CONLL2TXT) $(TRAIN_FILES) $(DEV_FILEs) $(TEST_FILES)
......
...@@ -31,7 +31,7 @@ if __name__ == "__main__" : ...@@ -31,7 +31,7 @@ if __name__ == "__main__" :
striped = line.strip() striped = line.strip()
if len(striped) == 0 : if len(striped) == 0 :
continue continue
print("WRITE b.0 UPOS " + striped, file=output) print("<tagger> WRITE b.0 UPOS " + striped, file=output)
output.close() output.close()
elif nameCol == "XPOS" : elif nameCol == "XPOS" :
...@@ -90,7 +90,7 @@ if __name__ == "__main__" : ...@@ -90,7 +90,7 @@ if __name__ == "__main__" :
print("SHIFT", file=output) print("SHIFT", file=output)
output.close() output.close()
output = open("parser.ts", 'w', encoding='utf-8') output = open("parser.ts", 'w', encoding='utf-8')
print("REDUCE", file=output) print("<parser> REDUCE", file=output)
labels = set() labels = set()
labelsList = [] labelsList = []
for line in open(colFile, "r", encoding='utf-8') : for line in open(colFile, "r", encoding='utf-8') :
...@@ -103,8 +103,9 @@ if __name__ == "__main__" : ...@@ -103,8 +103,9 @@ if __name__ == "__main__" :
labelsList.append(striped) labelsList.append(striped)
labelsList.sort() labelsList.sort()
for label in labelsList : for label in labelsList :
print("LEFT " + label, file=output) print("<parser> LEFT " + label, file=output)
print("RIGHT " + label, file=output) print("<parser> RIGHT " + label, file=output)
print("SHIFT", file=output) print("<parser> EOS", file=output)
print("<parser> 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