Commit c2321da55ae02b753ea0c8dcce200e2871d73d64
1 parent
6a35d720
poprawione 'dokładniej' w imporcie skrotow
Showing
1 changed file
with
11 additions
and
3 deletions
dictionary/management/commands/import_skr.py
... | ... | @@ -47,7 +47,7 @@ def import_skr(db_name): |
47 | 47 | qual_dict[q_label] = q.id |
48 | 48 | |
49 | 49 | attrs = {} |
50 | - for attr_name, field, closed in SKR_ATTRS: | |
50 | + for attr_name, column, closed in SKR_ATTRS: | |
51 | 51 | la, created = LexemeAttribute.objects.get_or_create( |
52 | 52 | name=attr_name, closed=closed) |
53 | 53 | for pos in ('skrl', 'skrw', 'skrf'): |
... | ... | @@ -80,8 +80,16 @@ def import_skr(db_name): |
80 | 80 | vocab.add_lexeme(l) |
81 | 81 | LexemeInflectionPattern.objects.create( |
82 | 82 | lexeme=l, pattern=pattern, index=1, root=entry) |
83 | - for attr_name, field, closed in SKR_ATTRS: | |
84 | - attrs[attr_name].add_lexeme(l, row[field]) | |
83 | + for attr_name, column, closed in SKR_ATTRS: | |
84 | + data = row[column] | |
85 | + if attr_name == u'dokładniej': | |
86 | + if pos == 'skrl': | |
87 | + data = u'skrót leksemu, ' + data | |
88 | + elif pos == 'skrw': | |
89 | + data = u'skrót wyrażenia, ' + data | |
90 | + else: # pos == 'skrf' | |
91 | + data = u'skrót formy ' + data | |
92 | + attrs[attr_name].add_lexeme(l, data) | |
85 | 93 | for qual in quals: |
86 | 94 | l.qualifiers.add(qual_dict[qual]) |
87 | 95 | l.refresh_qualifiers_cache() |
... | ... |