Commit a15b2a3897b62f3eedfbb7d3a10cca71ea8992f3

Authored by janek37
1 parent 5efc8689

formy podstawowe przy złych imiesłowach

dictionary/management/commands/wrong_derivatives.py
... ... @@ -34,19 +34,19 @@ def wrong_derivatives():
34 34 for data in ppas_data(l):
35 35 der = create_derivative(
36 36 l, data['pos'], data['entry'], data['index'], pl=data['pl'])
37   - wrong_participles |= der.all_forms()
  37 + wrong_participles |= set((f, l.entry) for f in der.all_forms())
38 38 for l in dk:
39 39 for data in pact_data(l):
40 40 der = create_derivative(
41 41 l, data['pos'], data['entry'], data['index'])
42   - wrong_participles |= der.all_forms()
  42 + wrong_participles |= set((f, l.entry) for f in der.all_forms())
43 43 lips = list(l.lexemeinflectionpattern_set.all())
44 44 for lip in lips:
45 45 pattern = lip.pattern
46 46 endings3 = Ending.objects.filter(
47 47 pattern=pattern, base_form_label__symbol='3')
48 48 for ending in endings3:
49   - wrong_participles.add(lip.root + ending.string + u'c')
  49 + wrong_participles.add((lip.root + ending.string + u'c', l.entry))
50 50 for l in ndk:
51 51 lips = list(l.lexemeinflectionpattern_set.all())
52 52 for lip in lips:
... ... @@ -54,10 +54,13 @@ def wrong_derivatives():
54 54 endings6p = Ending.objects.filter(
55 55 pattern=pattern, base_form_label__symbol="6'")
56 56 for ending in endings6p:
57   - wrong_participles.add(lip.root + ending.string + u'szy')
  57 + wrong_participles.add((lip.root + ending.string + u'szy', l.entry))
58 58  
59   - wrong_participles -= set(LexemeForm.objects.values_list('form', flat=True))
60   - for p in sorted(wrong_participles):
  59 + wrong_participles_forms = set(form for form, entry in wrong_participles)
  60 + wrong_participles_forms -= set(LexemeForm.objects.values_list('form', flat=True))
  61 + wrong_participles = sorted(
  62 + (form, entry) for form, entry in wrong_participles if form not in wrong_participles_forms)
  63 + for p in wrong_participles:
61 64 uniprint(p)
62 65  
63 66 transaction.rollback()
... ...