Commit 5688d9cb authored by Arndt Heilmann's avatar Arndt Heilmann
Browse files

Fixed issue

parent 39419daa
......@@ -64,41 +64,42 @@ for translation in TokKDdict:
with open("..\\ManualRealignment\\"+translation+".pzl","w",encoding="utf-8") as outfile:
for i,token in enumerate(sorted(list(TokKDdict[translation].keys()))):
# token=str(token)
line=[]
header=[]
if i==0:
header.append("Translation")
header.append("CharId")
header.append("TTokenId")
header.append("TToken")
outfile.write("\t".join(header)+"\n")
line=[]
line.append(translation)
line.append("TT")
line.append("Chars")
line.append(token)
line.append(tokenidentifierdict[translation]["FinalText"][token].replace("\"","\\\""))
if token in tokenidentifierdict:
line=[]
header=[]
if i==0:
header.append("Translation")
header.append("CharId")
header.append("TTokenId")
header.append("TToken")
outfile.write("\t".join(header)+"\n")
line=[]
line.append(translation)
line.append("TT")
line.append("Chars")
line.append(token)
line.append(tokenidentifierdict[translation]["FinalText"][token].replace("\"","\\\""))
for ids in TokKDdict[translation][token]["Id"]:
# if KDdict[translation][ids].setdefault("Value","")=="[Return]":
# char="/"
if KDdict[translation][ids].setdefault("Value","")=="\"":
char="\\\""
# print("HEHAHDH")
else:
char=KDdict[translation][ids]["chr"]
line.append(char)
outfile.write("\t".join([str(x) for x in line])+"\n")
line=[]
line.append(translation)
line.append("TT")
line.append("Ids")
line.append(token)
line.append(tokenidentifierdict[translation]["FinalText"][token].replace("\"","\\\""))
for ids in TokKDdict[translation][token]["Id"]:
line.append(ids)
outfile.write("\t".join([str(x) for x in line])+"\n")
for ids in TokKDdict[translation][token]["Id"]:
# if KDdict[translation][ids].setdefault("Value","")=="[Return]":
# char="/"
if KDdict[translation][ids].setdefault("Value","")=="\"":
char="\\\""
# print("HEHAHDH")
else:
char=KDdict[translation][ids]["chr"]
line.append(char)
outfile.write("\t".join([str(x) for x in line])+"\n")
line=[]
line.append(translation)
line.append("TT")
line.append("Ids")
line.append(token)
line.append(tokenidentifierdict[translation]["FinalText"][token].replace("\"","\\\""))
for ids in TokKDdict[translation][token]["Id"]:
line.append(ids)
outfile.write("\t".join([str(x) for x in line])+"\n")
\ No newline at end of file
Markdown is supported
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