Commit c95e555ef3078d33fb4728ac8572cbeef804d7d0
1 parent
e5f0e05e
złe imiesłowy dla niewłaściwych
Showing
1 changed file
with
7 additions
and
6 deletions
dictionary/management/commands/wrong_derivatives.py
... | ... | @@ -13,8 +13,8 @@ class Command(BaseCommand): |
13 | 13 | def handle(self, *args, **options): |
14 | 14 | wrong_derivatives() |
15 | 15 | |
16 | -INTRANS = LexemeAttributeValue.objects.get( | |
17 | - attribute__name=u'przechodniość', value='iT') | |
16 | +INTRANS = LexemeAttributeValue.objects.get(attribute__name=u'przechodniość', value='iT') | |
17 | +IMPROPER = LexemeAttributeValue.objects.get(attribute__name=u'właściwy', value='Q') | |
18 | 18 | DK = LexemeAttributeValue.objects.get(attribute__name=u'aspekt', value='dk') |
19 | 19 | NDK = LexemeAttributeValue.objects.get(attribute__name=u'aspekt', value='ndk') |
20 | 20 | |
... | ... | @@ -24,18 +24,19 @@ def wrong_derivatives(): |
24 | 24 | transaction.managed() |
25 | 25 | |
26 | 26 | no_history() |
27 | - verbs = Lexeme.objects.filter(part_of_speech='v', owner_vocabulary='SGJP') | |
27 | + verbs = Lexeme.objects.filter(part_of_speech='v', owner_vocabulary='SGJP', entry__startswith='bra') | |
28 | 28 | intrans = verbs.filter(lexemeattributevalue=INTRANS) |
29 | + improper = verbs.filter(lexemeattributevalue=IMPROPER) | |
29 | 30 | dk = verbs.filter(lexemeattributevalue=DK) |
30 | 31 | ndk = verbs.filter(lexemeattributevalue=NDK) |
31 | 32 | |
32 | 33 | wrong_participles = set() |
33 | - for l in intrans: | |
34 | + for l in intrans | improper: | |
34 | 35 | for data in ppas_data(l): |
35 | 36 | der = create_derivative( |
36 | 37 | l, data['pos'], data['entry'], data['index'], pl=data['pl']) |
37 | 38 | wrong_participles |= set((f, l.entry) for f in der.all_forms()) |
38 | - for l in dk: | |
39 | + for l in dk | improper: | |
39 | 40 | for data in pact_data(l): |
40 | 41 | der = create_derivative( |
41 | 42 | l, data['pos'], data['entry'], data['index']) |
... | ... | @@ -47,7 +48,7 @@ def wrong_derivatives(): |
47 | 48 | pattern=pattern, base_form_label__symbol='3') |
48 | 49 | for ending in endings3: |
49 | 50 | wrong_participles.add((lip.root + ending.string + u'c', l.entry)) |
50 | - for l in ndk: | |
51 | + for l in ndk | improper: | |
51 | 52 | lips = list(l.lexemeinflectionpattern_set.all()) |
52 | 53 | for lip in lips: |
53 | 54 | pattern = lip.pattern |
... | ... |