Commit 4b71d8ce95ef32bbd73d25274859fed997a63292

Authored by Bartłomiej Nitoń
1 parent 2bb03799

Added new feature to find_hanging_examples script.

semantics/management/commands/find_hanging_examples.py
... ... @@ -38,3 +38,12 @@ def print_hanging_examples(lemma):
38 38 example.id)
39 39 for ex in same_lu_examples.all():
40 40 print 'lu_ex_id: %d' % ex.id
  41 + for example in lemma.nkjp_examples.all():
  42 + same_lu_examples = LexicalUnitExamples.objects.filter(example=example, lexical_unit__in=lex_units)
  43 + if same_lu_examples.count() > 1:
  44 + print '!!!!!!!!!!!! two lus pinned to same example !!!!!!!!!!!!!!!!!!!'
  45 + for lu_ex in same_lu_examples:
  46 + print 'same example pinned multiple times --> lemma: %s\tlu_ex_id: %d\texample: %s\tex_id: %d' % (lemma.entry_obj.name,
  47 + lu_ex.id,
  48 + example.sentence,
  49 + example.id)
41 50 \ No newline at end of file
... ...