Commit d0dc702a119a514c13aea8e9384015f5d4988b5c

Authored by janek37
1 parent 85716dbc

poprawka do eksportu (pałki)

dictionary/export.py
... ... @@ -159,20 +159,23 @@ def export_lexemes(data=None, output_file=None):
159 159 else:
160 160 entry, form, pos, _ic, tag, _id, refl_id = row
161 161 form = form.lstrip('+') # odmienne postfiksy
  162 + tags = None
162 163 if tag == 'adja':
163 164 form = form.rstrip('+')
164 165 if tag == 'adjc':
165 166 if form not in ADJPREDYKATYWNE:
166   - tag = "adj:sg:nom:m1.m2.m3:pos|adj:sg:acc:m3:pos"
  167 + tags = "adj:sg:nom:m1.m2.m3:pos|adj:sg:acc:m3:pos"
167 168 if refl and pos in ('v', 'pact', 'ger'):
168 169 if refl_id in refls:
169 170 tag += ':' + REFL_TRANSLATION[refls[refl_id]]
170 171 else:
171 172 debug(entry, u'Nieznana zwrotność: %s' % refl_id)
172   - if data['commonness']:
173   - cv = cv_table[cv_id] if cv_id else ''
174   - output_file.write((u'%s\t%s\t%s\t%s\n' %
175   - (form, entry, tag, cv)).encode('utf-8'))
176   - else:
177   - output_file.write((u'%s\t%s\t%s\n' %
178   - (form, entry, tag)).encode('utf-8'))
  173 + tags = tags or [tag]
  174 + for tag in tags:
  175 + if data['commonness']:
  176 + cv = cv_table[cv_id] if cv_id else ''
  177 + output_file.write((u'%s\t%s\t%s\t%s\n' %
  178 + (form, entry, tag, cv)).encode('utf-8'))
  179 + else:
  180 + output_file.write((u'%s\t%s\t%s\n' %
  181 + (form, entry, tag)).encode('utf-8'))
... ...
dictionary/migrations/0012_translate_refl.py
... ... @@ -14,7 +14,7 @@ class Migration(DataMigration):
14 14 attr, created = orm.LexemeAttribute.objects.get_or_create(
15 15 name=u'zwrotność',
16 16 closed=True,
17   - lexical_class=orm.LexicalClass.objects.get(symbol='v'),
  17 + lexical_class=orm.LexicalClass.objects.get_or_create(symbol='v')[0],
18 18 )
19 19 for v in REFL:
20 20 orm.LexemeAttributeValue.objects.get_or_create(
... ...