Commit 9f533bb7b5881371f0d93e4f85bd024b83305ed8

Authored by Katarzyna Krasnowska
1 parent ba0cb43f

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

Showing 1 changed file with 13 additions and 2 deletions
importer/Example.py
... ... @@ -81,9 +81,13 @@ class Example:
81 81 note=self._note)
82 82 example.save()
83 83 if not self._phrases.exists():
  84 + print(' STORING EXAMPLE:', self._sentence)
  85 + print(' example not connected to syntax')
84 86 # example not connected to syntax
85 87 pass
86 88 elif self._arguments is None:
  89 + print(' STORING EXAMPLE:', self._sentence)
  90 + print(' example connected to syntax but not connected to semantics')
87 91 # example connected to syntax but not connected to semantics
88 92 connection = ExampleConnection(example=example)
89 93 connection.save()
... ... @@ -102,6 +106,7 @@ class Example:
102 106 hook.save()
103 107 connection.schema_connections.add(hook)
104 108 elif self._arguments.exists():
  109 + #print(' example connected to both syntax and semantics and connection can be transfered')
105 110 # example connected to both syntax and semantics
106 111 # and connection can be transfered
107 112 lemma, meaning = meanings[self._meaning]
... ... @@ -126,6 +131,8 @@ class Example:
126 131 hook.save()
127 132 connection.schema_connections.add(hook)
128 133 else:
  134 + print(' STORING EXAMPLE:', self._sentence)
  135 + 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')
129 136 # example connected to both syntax and semantics
130 137 # but connection cannot be transfered
131 138 # or connected to schema but not to any phrases in it
... ... @@ -205,6 +212,8 @@ class IllustratesSemantics:
205 212 lu = meanings.locate(meaning)
206 213 misconnected.write('% ' + sentence + '\n')
207 214 misconnected.write(base + '\t' + str(lu) + '\t' + str(illustrated_syntax._schema_key) + '\t' + str(eid) + '\n\n')
  215 + # KKK return None here to attach only to schema? (e.g. awaria)
  216 + return None
208 217 else:
209 218 max_args = max(possible_arguments.keys())
210 219 if len(possible_arguments[max_args]) > 1:
... ... @@ -224,13 +233,15 @@ class IllustratesSemantics:
224 233 if argument_str not in l3s[0]:
225 234 equal = False
226 235 l3s.append('\t' + '\t'.join(roles))
227   - if equal:
  236 + #if equal:
  237 + if True:
228 238 arguments = []
229 239 for role_illustrations, free in possible_arguments[max_args]:
230 240 arguments += role_illustrations
231 241 arguments += free
232 242 print(('\n'.join(l3s) + '\n'))
233   - else:
  243 + #else:
  244 + if not equal:
234 245 out_file.write(l1)
235 246 out_file.write(l2)
236 247 out_file.write('\n'.join(l3s) + '\n')
... ...