Commit 5d4ceed4 authored by Arndt Heilmann's avatar Arndt Heilmann
Browse files

Added a saveguard against overwriting .pzl files

parent f4c09759
......@@ -32,34 +32,34 @@ Id Study Session SL TL Task Text Part OrigTime Time Pause Border Type Cursor Cha
30 SG12 P01_T1 en de T 1 P01 20265 20265 109 0 Mins 30 r 1 3+6 4 1 0 0 0 0 1 0
31 SG12 P01_T1 en de T 1 P01 20468 20468 203 0 Mins 31 d 1 3+6 4 1 0 0 0 0 1 0
32 SG12 P01_T1 en de T 1 P01 20608 20608 140 0 Mins 32 _ 1 3+6 4 1 0 0 0 0 1 0
33 SG12 P01_T1 en de T 1 P01 20826 20826 218 0 Mins 33 z 1 3+6 6 1 0 0 0 0 1 0
34 SG12 P01_T1 en de T 1 P01 20951 20951 125 0 Mins 34 u 1 3+6 6 1 0 0 0 0 1 0
35 SG12 P01_T1 en de T 1 P01 21138 21138 187 0 Mins 35 r 1 3+6 6 1 0 0 0 0 1 0
36 SG12 P01_T1 en de T 1 P01 21248 21248 110 0 Mins 36 _ 1 3+6 6 1 0 0 0 0 1 0
37 SG12 P01_T1 en de T 1 P01 21560 21560 312 0 Mins 37 v 1 3+6 5 1 0 0 0 0 1 0
38 SG12 P01_T1 en de T 1 P01 21653 21653 93 0 Mins 38 i 1 3+6 5 1 0 0 0 0 1 0
39 SG12 P01_T1 en de T 1 P01 21762 21762 109 0 Mins 39 e 1 3+6 5 1 0 0 0 0 1 0
40 SG12 P01_T1 en de T 1 P01 21809 21809 47 0 Mins 40 r 1 3+6 5 1 0 0 0 0 1 0
41 SG12 P01_T1 en de T 1 P01 21996 21996 187 0 Mins 41 f 1 3+6 5 1 0 0 0 0 1 0
42 SG12 P01_T1 en de T 1 P01 22090 22090 94 0 Mins 42 a 1 3+6 5 1 0 0 0 0 1 0
43 SG12 P01_T1 en de T 1 P01 22184 22184 94 0 Mins 43 c 1 3+6 5 1 0 0 0 0 1 0
44 SG12 P01_T1 en de T 1 P01 22277 22277 93 0 Mins 44 h 1 3+6 5 1 0 0 0 0 1 0
45 SG12 P01_T1 en de T 1 P01 22418 22418 141 0 Mins 45 e 1 3+6 5 1 0 0 0 0 1 0
46 SG12 P01_T1 en de T 1 P01 22480 22480 62 0 Mins 46 r 1 3+6 5 1 0 0 0 0 10 0
47 SG12 P01_T1 en de T 1 P01 23946 23946 1466 0 Mdel 36 [_] 1 3+6 5 1 0 0 0 0 1 0
48 SG12 P01_T1 en de T 1 P01 24165 24165 219 0 Mdel 35 [r] 1 3+6 5 1 0 0 0 0 1 0
49 SG12 P01_T1 en de T 1 P01 24336 24336 171 0 Mdel 34 [u] 1 3+6 5 1 0 0 0 0 1 0
50 SG12 P01_T1 en de T 1 P01 24467 24467 131 0 Mdel 33 [_] 1 3+6 5 1 0 0 0 0 1 0
51 SG12 P01_T1 en de T 1 P01 24468 24468 1 0 Mdel 34 [_] 1 3+6 5 1 0 0 0 0 1 0
52 SG12 P01_T1 en de T 1 P01 24469 24469 1 0 Mdel 35 [_] 1 3+6 5 1 0 0 0 0 1 0
53 SG12 P01_T1 en de T 1 P01 24470 24470 1 0 Mdel 36 [_] 1 3+6 5 1 0 0 0 0 1 0
54 SG12 P01_T1 en de T 1 P01 24471 24471 1 0 Mdel 37 [_] 1 3+6 5 1 0 0 0 0 1 0
55 SG12 P01_T1 en de T 1 P01 24472 24472 1 0 Mdel 38 [_] 1 3+6 5 1 0 0 0 0 1 0
56 SG12 P01_T1 en de T 1 P01 24473 24473 1 0 Mdel 39 [_] 1 3+6 5 1 0 0 0 0 1 0
57 SG12 P01_T1 en de T 1 P01 24474 24474 1 0 Mdel 40 [_] 1 3+6 5 1 0 0 0 0 1 0
58 SG12 P01_T1 en de T 1 P01 24475 24475 1 0 Mdel 41 [_] 1 3+6 5 1 0 0 0 0 1 0
59 SG12 P01_T1 en de T 1 P01 24476 24476 1 0 Mdel 42 [_] 1 3+6 5 1 0 0 0 0 1 0
60 SG12 P01_T1 en de T 1 P01 24477 24477 1 0 Mdel 43 [_] 1 3+6 5 1 0 0 0 0 10 1
33 SG12 P01_T1 en de T 1 P01 20826 20826 218 0 Mins 33 z 1 3+6 4 1 0 0 0 0 1 0
34 SG12 P01_T1 en de T 1 P01 20951 20951 125 0 Mins 34 u 1 3+6 4 1 0 0 0 0 1 0
35 SG12 P01_T1 en de T 1 P01 21138 21138 187 0 Mins 35 r 1 3+6 4 1 0 0 0 0 1 0
36 SG12 P01_T1 en de T 1 P01 21248 21248 110 0 Mins 36 _ 1 3+6 4 1 0 0 0 0 1 0
37 SG12 P01_T1 en de T 1 P01 21560 21560 312 0 Mins 37 v 1 3+6 4 1 0 0 0 0 1 0
38 SG12 P01_T1 en de T 1 P01 21653 21653 93 0 Mins 38 i 1 3+6 4 1 0 0 0 0 1 0
39 SG12 P01_T1 en de T 1 P01 21762 21762 109 0 Mins 39 e 1 3+6 4 1 0 0 0 0 1 0
40 SG12 P01_T1 en de T 1 P01 21809 21809 47 0 Mins 40 r 1 3+6 4 1 0 0 0 0 1 0
41 SG12 P01_T1 en de T 1 P01 21996 21996 187 0 Mins 41 f 1 3+6 4 1 0 0 0 0 1 0
42 SG12 P01_T1 en de T 1 P01 22090 22090 94 0 Mins 42 a 1 3+6 4 1 0 0 0 0 1 0
43 SG12 P01_T1 en de T 1 P01 22184 22184 94 0 Mins 43 c 1 3+6 4 1 0 0 0 0 1 0
44 SG12 P01_T1 en de T 1 P01 22277 22277 93 0 Mins 44 h 1 3+6 4 1 0 0 0 0 1 0
45 SG12 P01_T1 en de T 1 P01 22418 22418 141 0 Mins 45 e 1 3+6 4 1 0 0 0 0 1 0
46 SG12 P01_T1 en de T 1 P01 22480 22480 62 0 Mins 46 r 1 3+6 4 1 0 0 0 0 10 0
47 SG12 P01_T1 en de T 1 P01 23946 23946 1466 0 Mdel 36 [_] 1 3+6 4 1 0 0 0 0 1 0
48 SG12 P01_T1 en de T 1 P01 24165 24165 219 0 Mdel 35 [r] 1 3+6 4 1 0 0 0 0 1 0
49 SG12 P01_T1 en de T 1 P01 24336 24336 171 0 Mdel 34 [u] 1 3+6 4 1 0 0 0 0 1 0
50 SG12 P01_T1 en de T 1 P01 24467 24467 131 0 Mdel 33 [_] 1 3+6 4 1 0 0 0 0 1 0
51 SG12 P01_T1 en de T 1 P01 24468 24468 1 0 Mdel 34 [_] 1 3+6 4 1 0 0 0 0 1 0
52 SG12 P01_T1 en de T 1 P01 24469 24469 1 0 Mdel 35 [_] 1 3+6 4 1 0 0 0 0 1 0
53 SG12 P01_T1 en de T 1 P01 24470 24470 1 0 Mdel 36 [_] 1 3+6 4 1 0 0 0 0 1 0
54 SG12 P01_T1 en de T 1 P01 24471 24471 1 0 Mdel 37 [_] 1 3+6 4 1 0 0 0 0 1 0
55 SG12 P01_T1 en de T 1 P01 24472 24472 1 0 Mdel 38 [_] 1 3+6 4 1 0 0 0 0 1 0
56 SG12 P01_T1 en de T 1 P01 24473 24473 1 0 Mdel 39 [_] 1 3+6 4 1 0 0 0 0 1 0
57 SG12 P01_T1 en de T 1 P01 24474 24474 1 0 Mdel 40 [_] 1 3+6 4 1 0 0 0 0 1 0
58 SG12 P01_T1 en de T 1 P01 24475 24475 1 0 Mdel 41 [_] 1 3+6 4 1 0 0 0 0 1 0
59 SG12 P01_T1 en de T 1 P01 24476 24476 1 0 Mdel 42 [_] 1 3+6 4 1 0 0 0 0 1 0
60 SG12 P01_T1 en de T 1 P01 24477 24477 1 0 Mdel 43 [_] 1 3+6 4 1 0 0 0 0 10 1
61 SG12 P01_T1 en de T 1 P01 26271 26271 1794 1 Mins 33 v 1 4 5 1 0 0 0 0 1 0
62 SG12 P01_T1 en de T 1 P01 26411 26411 140 0 Mins 34 i 1 4 5 1 0 0 0 0 1 0
63 SG12 P01_T1 en de T 1 P01 26505 26505 94 0 Mins 35 e 1 4 5 1 0 0 0 0 1 0
......@@ -69,52 +69,52 @@ Id Study Session SL TL Task Text Part OrigTime Time Pause Border Type Cursor Cha
67 SG12 P01_T1 en de T 1 P01 26926 26926 94 0 Mins 39 c 1 4 5 1 0 0 0 0 1 0
68 SG12 P01_T1 en de T 1 P01 27051 27051 125 0 Mins 40 h 1 4 5 1 0 0 0 0 1 0
69 SG12 P01_T1 en de T 1 P01 27144 27144 93 0 Mins 41 _ 1 4 5 1 0 0 0 0 1 0
70 SG12 P01_T1 en de T 1 P01 27722 27722 578 0 Mins 42 l 1 4 7 1 0 0 0 0 1 0
71 SG12 P01_T1 en de T 1 P01 27846 27846 124 0 Mins 43 e 1 4 7 1 0 0 0 0 1 0
72 SG12 P01_T1 en de T 1 P01 27987 27987 141 0 Mins 44 b 1 4 7 1 0 0 0 0 1 0
73 SG12 P01_T1 en de T 1 P01 28065 28065 78 0 Mins 45 e 1 4 7 1 0 0 0 0 1 0
74 SG12 P01_T1 en de T 1 P01 28158 28158 93 0 Mins 46 n 1 4 7 1 0 0 0 0 1 0
75 SG12 P01_T1 en de T 1 P01 28283 28283 125 0 Mins 47 s 1 4 7 1 0 0 0 0 1 0
76 SG12 P01_T1 en de T 1 P01 28938 28938 655 0 Mins 48 l 1 4 7 1 0 0 0 0 1 0
77 SG12 P01_T1 en de T 1 P01 29016 29016 78 0 Mins 49 a 1 4 7 1 0 0 0 0 1 0
78 SG12 P01_T1 en de T 1 P01 29204 29204 188 0 Mins 50 n 1 4 7 1 0 0 0 0 1 0
79 SG12 P01_T1 en de T 1 P01 29266 29266 62 0 Mins 51 g 1 4 7 1 0 0 0 0 1 0
80 SG12 P01_T1 en de T 1 P01 29344 29344 78 0 Mins 52 _ 1 4 7 1 0 0 0 0 1 0
81 SG12 P01_T1 en de T 1 P01 30311 30311 967 0 Mins 53 v 1 4 7 1 0 0 0 0 1 0
82 SG12 P01_T1 en de T 1 P01 30498 30498 187 0 Mins 54 e 1 4 7 1 0 0 0 0 1 0
83 SG12 P01_T1 en de T 1 P01 30561 30561 63 0 Mins 55 r 1 4 7 1 0 0 0 0 1 0
84 SG12 P01_T1 en de T 1 P01 30748 30748 187 0 Mins 56 u 1 4 7 1 0 0 0 0 1 0
85 SG12 P01_T1 en de T 1 P01 30764 30764 16 0 Mins 57 z 1 4 7 1 0 0 0 0 1 0
86 SG12 P01_T1 en de T 1 P01 30826 30826 62 0 Mins 58 r 1 4 7 1 0 0 0 0 0 0
87 SG12 P01_T1 en de T 1 P01 31310 31310 484 0 Mdel 58 [r] 1 4 7 1 0 0 0 0 1 0
88 SG12 P01_T1 en de T 1 P01 31466 31466 156 0 Mdel 57 [z] 1 4 7 1 0 0 0 0 0 0
89 SG12 P01_T1 en de T 1 P01 31544 31544 78 0 Mins 57 r 1 4 7 1 0 0 0 0 1 0
90 SG12 P01_T1 en de T 1 P01 31793 31793 249 0 Mins 58 t 1 4 7 1 0 0 0 0 1 0
91 SG12 P01_T1 en de T 1 P01 31840 31840 47 0 Mins 59 e 1 4 7 1 0 0 0 0 1 0
92 SG12 P01_T1 en de T 1 P01 31918 31918 78 0 Mins 60 i 1 4 7 1 0 0 0 0 1 0
93 SG12 P01_T1 en de T 1 P01 32090 32090 172 0 Mins 61 l 1 4 7 1 0 0 0 0 1 0
94 SG12 P01_T1 en de T 1 P01 32152 32152 62 0 Mins 62 t 1 4 7 1 0 0 0 0 10 0
95 SG12 P01_T1 en de T 1 P01 34732 34732 2580 0 Mdel 52 [_] 1 4 7 1 0 0 0 0 1 0
96 SG12 P01_T1 en de T 1 P01 34733 34733 1 0 Mdel 53 [_] 1 4 7 1 0 0 0 0 1 0
97 SG12 P01_T1 en de T 1 P01 34734 34734 1 0 Mdel 54 [_] 1 4 7 1 0 0 0 0 1 0
98 SG12 P01_T1 en de T 1 P01 34735 34735 1 0 Mdel 55 [_] 1 4 7 1 0 0 0 0 1 0
99 SG12 P01_T1 en de T 1 P01 34736 34736 1 0 Mdel 56 [_] 1 4 7 1 0 0 0 0 1 0
100 SG12 P01_T1 en de T 1 P01 34737 34737 1 0 Mdel 57 [_] 1 4 7 1 0 0 0 0 1 0
101 SG12 P01_T1 en de T 1 P01 34738 34738 1 0 Mdel 58 [_] 1 4 7 1 0 0 0 0 1 0
102 SG12 P01_T1 en de T 1 P01 34739 34739 1 0 Mdel 59 [_] 1 4 7 1 0 0 0 0 1 0
103 SG12 P01_T1 en de T 1 P01 34740 34740 1 0 Mdel 60 [_] 1 4 7 1 0 0 0 0 1 0
104 SG12 P01_T1 en de T 1 P01 34741 34741 1 0 Mdel 61 [_] 1 4 7 1 0 0 0 0 1 0
105 SG12 P01_T1 en de T 1 P01 34742 34742 1 0 Mdel 62 [_] 1 4 7 1 0 0 0 0 11 0
106 SG12 P01_T1 en de T 1 P01 34960 34960 218 0 Mdel 51 [g] 1 4 7 1 0 0 0 0 1 0
107 SG12 P01_T1 en de T 1 P01 35116 35116 156 0 Mdel 50 [n] 1 4 7 1 0 0 0 0 1 0
108 SG12 P01_T1 en de T 1 P01 35288 35288 172 0 Mdel 49 [a] 1 4 7 1 0 0 0 0 0 0
109 SG12 P01_T1 en de T 1 P01 35522 35522 234 0 Mins 49 ä 1 4 7 1 0 0 0 0 1 0
110 SG12 P01_T1 en de T 1 P01 35912 35912 390 0 Mins 50 n 1 4 7 1 0 0 0 0 1 0
111 SG12 P01_T1 en de T 1 P01 36021 36021 109 0 Mins 51 g 1 4 7 1 0 0 0 0 1 0
112 SG12 P01_T1 en de T 1 P01 36239 36239 218 0 Mins 52 l 1 4 7 1 0 0 0 0 1 0
113 SG12 P01_T1 en de T 1 P01 36426 36426 187 0 Mins 53 i 1 4 7 1 0 0 0 0 1 0
114 SG12 P01_T1 en de T 1 P01 36520 36520 94 0 Mins 54 c 1 4 7 1 0 0 0 0 1 0
115 SG12 P01_T1 en de T 1 P01 36614 36614 94 0 Mins 55 h 1 4 7 1 0 0 0 0 18 0
70 SG12 P01_T1 en de T 1 P01 27722 27722 578 0 Mins 42 l 1 4 5 1 0 0 0 0 1 0
71 SG12 P01_T1 en de T 1 P01 27846 27846 124 0 Mins 43 e 1 4 5 1 0 0 0 0 1 0
72 SG12 P01_T1 en de T 1 P01 27987 27987 141 0 Mins 44 b 1 4 5 1 0 0 0 0 1 0
73 SG12 P01_T1 en de T 1 P01 28065 28065 78 0 Mins 45 e 1 4 5 1 0 0 0 0 1 0
74 SG12 P01_T1 en de T 1 P01 28158 28158 93 0 Mins 46 n 1 4 5 1 0 0 0 0 1 0
75 SG12 P01_T1 en de T 1 P01 28283 28283 125 0 Mins 47 s 1 4 5 1 0 0 0 0 1 0
76 SG12 P01_T1 en de T 1 P01 28938 28938 655 0 Mins 48 l 1 4 5 1 0 0 0 0 1 0
77 SG12 P01_T1 en de T 1 P01 29016 29016 78 0 Mins 49 a 1 4 5 1 0 0 0 0 1 0
78 SG12 P01_T1 en de T 1 P01 29204 29204 188 0 Mins 50 n 1 4 5 1 0 0 0 0 1 0
79 SG12 P01_T1 en de T 1 P01 29266 29266 62 0 Mins 51 g 1 4 5 1 0 0 0 0 1 0
80 SG12 P01_T1 en de T 1 P01 29344 29344 78 0 Mins 52 _ 1 4 5 1 0 0 0 0 1 0
81 SG12 P01_T1 en de T 1 P01 30311 30311 967 0 Mins 53 v 1 4 5 1 0 0 0 0 1 0
82 SG12 P01_T1 en de T 1 P01 30498 30498 187 0 Mins 54 e 1 4 5 1 0 0 0 0 1 0
83 SG12 P01_T1 en de T 1 P01 30561 30561 63 0 Mins 55 r 1 4 5 1 0 0 0 0 1 0
84 SG12 P01_T1 en de T 1 P01 30748 30748 187 0 Mins 56 u 1 4 5 1 0 0 0 0 1 0
85 SG12 P01_T1 en de T 1 P01 30764 30764 16 0 Mins 57 z 1 4 5 1 0 0 0 0 1 0
86 SG12 P01_T1 en de T 1 P01 30826 30826 62 0 Mins 58 r 1 4 5 1 0 0 0 0 0 0
87 SG12 P01_T1 en de T 1 P01 31310 31310 484 0 Mdel 58 [r] 1 4 5 1 0 0 0 0 1 0
88 SG12 P01_T1 en de T 1 P01 31466 31466 156 0 Mdel 57 [z] 1 4 5 1 0 0 0 0 0 0
89 SG12 P01_T1 en de T 1 P01 31544 31544 78 0 Mins 57 r 1 4 5 1 0 0 0 0 1 0
90 SG12 P01_T1 en de T 1 P01 31793 31793 249 0 Mins 58 t 1 4 5 1 0 0 0 0 1 0
91 SG12 P01_T1 en de T 1 P01 31840 31840 47 0 Mins 59 e 1 4 5 1 0 0 0 0 1 0
92 SG12 P01_T1 en de T 1 P01 31918 31918 78 0 Mins 60 i 1 4 5 1 0 0 0 0 1 0
93 SG12 P01_T1 en de T 1 P01 32090 32090 172 0 Mins 61 l 1 4 5 1 0 0 0 0 1 0
94 SG12 P01_T1 en de T 1 P01 32152 32152 62 0 Mins 62 t 1 4 5 1 0 0 0 0 10 0
95 SG12 P01_T1 en de T 1 P01 34732 34732 2580 0 Mdel 52 [_] 1 4 5 1 0 0 0 0 1 0
96 SG12 P01_T1 en de T 1 P01 34733 34733 1 0 Mdel 53 [_] 1 4 5 1 0 0 0 0 1 0
97 SG12 P01_T1 en de T 1 P01 34734 34734 1 0 Mdel 54 [_] 1 4 5 1 0 0 0 0 1 0
98 SG12 P01_T1 en de T 1 P01 34735 34735 1 0 Mdel 55 [_] 1 4 5 1 0 0 0 0 1 0
99 SG12 P01_T1 en de T 1 P01 34736 34736 1 0 Mdel 56 [_] 1 4 5 1 0 0 0 0 1 0
100 SG12 P01_T1 en de T 1 P01 34737 34737 1 0 Mdel 57 [_] 1 4 5 1 0 0 0 0 1 0
101 SG12 P01_T1 en de T 1 P01 34738 34738 1 0 Mdel 58 [_] 1 4 5 1 0 0 0 0 1 0
102 SG12 P01_T1 en de T 1 P01 34739 34739 1 0 Mdel 59 [_] 1 4 5 1 0 0 0 0 1 0
103 SG12 P01_T1 en de T 1 P01 34740 34740 1 0 Mdel 60 [_] 1 4 5 1 0 0 0 0 1 0
104 SG12 P01_T1 en de T 1 P01 34741 34741 1 0 Mdel 61 [_] 1 4 5 1 0 0 0 0 1 0
105 SG12 P01_T1 en de T 1 P01 34742 34742 1 0 Mdel 62 [_] 1 4 5 1 0 0 0 0 11 0
106 SG12 P01_T1 en de T 1 P01 34960 34960 218 0 Mdel 51 [g] 1 4 5 1 0 0 0 0 1 0
107 SG12 P01_T1 en de T 1 P01 35116 35116 156 0 Mdel 50 [n] 1 4 5 1 0 0 0 0 1 0
108 SG12 P01_T1 en de T 1 P01 35288 35288 172 0 Mdel 49 [a] 1 4 5 1 0 0 0 0 0 0
109 SG12 P01_T1 en de T 1 P01 35522 35522 234 0 Mins 49 ä 1 4 5 1 0 0 0 0 1 0
110 SG12 P01_T1 en de T 1 P01 35912 35912 390 0 Mins 50 n 1 4 5 1 0 0 0 0 1 0
111 SG12 P01_T1 en de T 1 P01 36021 36021 109 0 Mins 51 g 1 4 5 1 0 0 0 0 1 0
112 SG12 P01_T1 en de T 1 P01 36239 36239 218 0 Mins 52 l 1 4 5 1 0 0 0 0 1 0
113 SG12 P01_T1 en de T 1 P01 36426 36426 187 0 Mins 53 i 1 4 5 1 0 0 0 0 1 0
114 SG12 P01_T1 en de T 1 P01 36520 36520 94 0 Mins 54 c 1 4 5 1 0 0 0 0 1 0
115 SG12 P01_T1 en de T 1 P01 36614 36614 94 0 Mins 55 h 1 4 5 1 0 0 0 0 18 0
116 SG12 P01_T1 en de T 1 P01 39045 39045 2431 0 Mdel 37 [_] 1 4 5 1 0 0 0 0 1 0
117 SG12 P01_T1 en de T 1 P01 39046 39046 1 0 Mdel 38 [_] 1 4 5 1 0 0 0 0 1 0
118 SG12 P01_T1 en de T 1 P01 39047 39047 1 0 Mdel 39 [_] 1 4 5 1 0 0 0 0 1 0
......
This diff is collapsed.
......@@ -57,43 +57,53 @@ for dirs,subdirs,files in os.walk("../KDFiles"):
#%%
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()))):
line=[]
header=[]
if i==0:
header.append("Translation")
header.append("CharId")
header.append("TTokenId")
header.append("TToken")
outfile.write("\t".join([str(x) for x in 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]["Char"]
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")
writefile=False
try:
open("..\\ManualRealignment\\"+translation+".pzl")
answer=input("Do you really want to overwrite "+translation+".pzl (y/n)")
if answer=="y":
writefile=True
except FileNotFoundError:
writefile=True
if writefile==True:
with open("..\\ManualRealignment\\"+translation+".pzl","w",encoding="utf-8") as outfile:
for i,token in enumerate(sorted(list(TokKDdict[translation].keys()))):
line=[]
header=[]
if i==0:
header.append("Translation")
header.append("CharId")
header.append("TTokenId")
header.append("TToken")
outfile.write("\t".join([str(x) for x in 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]["Char"]
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