Skip to content

Commit 5f9962a

Browse files
committed
more debugs
1 parent a92056a commit 5f9962a

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

scripts/vislcg-compare.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ def main():
159159
found_tags = True
160160
elif set(goldreading["tags"]).issubset(set(hypreading["tags"])):
161161
found_tags_subset = True
162-
if hypreading["suffixed"] == goldreading["suffixed"]:
163-
found_suffixed = True
162+
if "suffixed" in hypreading and "suffixed" in goldreading:
163+
if hypreading["suffixed"] == goldreading["suffixed"]:
164+
found_suffixed = True
164165
if matched:
165166
reading_matches += 1
166167
else:
@@ -170,8 +171,9 @@ def main():
170171
lemma_matches += 1
171172
else:
172173
lemma_misses += 1
173-
if options.level == "lemma" or options.level == "all":
174+
if options.level in ["lemma", "all"]:
174175
print(f"LEMMA\t{goldreading["lemma"]}\t",
176+
f" (surf: {gold["surf"]}\t{hyp["surf"]})",
175177
file=options.logfile)
176178
for hypothesis in hyp["readings"]:
177179
print(f"\t\t{hypothesis["lemma"]}",
@@ -180,16 +182,18 @@ def main():
180182
alltag_matches += 1
181183
elif found_alltags_subset:
182184
alltag_matches += 1
183-
if options.level == "alltags" or options.level == "all":
185+
if options.level in ["alltags", "all"]:
184186
print(f"ALLTAGS~\t{goldreading["alltags"]}",
187+
f" (surf: {gold["surf"]}\t{hyp["surf"]})",
185188
file=options.logfile)
186189
for hypothesis in hyp["readings"]:
187190
print(f"\t~\t{hypothesis["alltags"]}",
188191
file=options.logfile)
189192
else:
190193
alltag_misses += 1
191-
if options.level == "alltags" or options.level == "all":
194+
if options.level in ["alltags", "all"]:
192195
print(f"ALLTAGS\t{goldreading["alltags"]}",
196+
f" (surf: {gold["surf"]}\t{hyp["surf"]})",
193197
file=options.logfile)
194198
for hypothesis in hyp["readings"]:
195199
print(f"\t!=\t{hypothesis["alltags"]}",
@@ -198,16 +202,18 @@ def main():
198202
tag_matches += 1
199203
elif found_tags_subset:
200204
tag_matches += 1
201-
if options.level == "tags" or options.level == "all":
205+
if options.level in ["tags", "all"]:
202206
print(f"TAGS~\t{goldreading["tags"]}",
207+
f" (surf: {gold["surf"]}\t{hyp["surf"]})",
203208
file=options.logfile)
204209
for hypothesis in hyp["readings"]:
205210
print(f"\t~\t{hypothesis["tags"]}",
206211
file=options.logfile)
207212
else:
208213
tag_misses += 1
209-
if options.level == "tags" or options.level == "all":
214+
if options.level in ["tags", "all"]:
210215
print(f"TAGS\t{goldreading["tags"]}",
216+
f" (surf: {gold["surf"]}\t{hyp["surf"]})",
211217
file=options.logfile)
212218
for hypothesis in hyp["readings"]:
213219
print(f"\t!=\t{hypothesis["tags"]}",
@@ -218,6 +224,7 @@ def main():
218224
suffixed_misses += 1
219225
if options.level == "suffixed":
220226
print("SUFFIX", ",".join(goldreading["suffixed"]),
227+
f" (surf: {gold["surf"]}\t{hyp["surf"]})",
221228
sep="\t", file=options.logfile)
222229
for hypothesis in hyp["readings"]:
223230
print(f"\t!=\t{hypothesis["suffixed"]}",

0 commit comments

Comments
 (0)