Skip to content
Snippets Groups Projects
Commit 24bfcf40 authored by Kasia Krasnowska's avatar Kasia Krasnowska
Browse files

TEST: import misconnected/ambiguous examples to look like Slowal, but report them as before

parent 52e28393
Branches
No related merge requests found
......@@ -81,9 +81,13 @@ class Example:
note=self._note)
example.save()
if not self._phrases.exists():
print(' STORING EXAMPLE:', self._sentence)
print(' example not connected to syntax')
# example not connected to syntax
pass
elif self._arguments is None:
print(' STORING EXAMPLE:', self._sentence)
print(' example connected to syntax but not connected to semantics')
# example connected to syntax but not connected to semantics
connection = ExampleConnection(example=example)
connection.save()
......@@ -102,6 +106,7 @@ class Example:
hook.save()
connection.schema_connections.add(hook)
elif self._arguments.exists():
#print(' example connected to both syntax and semantics and connection can be transfered')
# example connected to both syntax and semantics
# and connection can be transfered
lemma, meaning = meanings[self._meaning]
......@@ -126,6 +131,8 @@ class Example:
hook.save()
connection.schema_connections.add(hook)
else:
print(' STORING EXAMPLE:', self._sentence)
print(' example connected to both syntax and semantics but connection cannot be transfered or connected to schema but not to any phrases in it; treated as not connected to syntax')
# example connected to both syntax and semantics
# but connection cannot be transfered
# or connected to schema but not to any phrases in it
......@@ -205,6 +212,8 @@ class IllustratesSemantics:
lu = meanings.locate(meaning)
misconnected.write('% ' + sentence + '\n')
misconnected.write(base + '\t' + str(lu) + '\t' + str(illustrated_syntax._schema_key) + '\t' + str(eid) + '\n\n')
# KKK return None here to attach only to schema? (e.g. awaria)
return None
else:
max_args = max(possible_arguments.keys())
if len(possible_arguments[max_args]) > 1:
......@@ -224,13 +233,15 @@ class IllustratesSemantics:
if argument_str not in l3s[0]:
equal = False
l3s.append('\t' + '\t'.join(roles))
if equal:
#if equal:
if True:
arguments = []
for role_illustrations, free in possible_arguments[max_args]:
arguments += role_illustrations
arguments += free
print(('\n'.join(l3s) + '\n'))
else:
#else:
if not equal:
out_file.write(l1)
out_file.write(l2)
out_file.write('\n'.join(l3s) + '\n')
......
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