Commit 990d042c3d0c5099ebcbcf6cf34b4d1b9eff16a0
1 parent
bb84d879
Poprawka przy infps
Showing
2 changed files
with
10 additions
and
6 deletions
semantics/phraseology_generator.py
... | ... | @@ -184,12 +184,13 @@ def get_infps(aspect, verbs, atr): |
184 | 184 | if u'inf:' in tag: |
185 | 185 | filtered.append(option) |
186 | 186 | options = filtered |
187 | + filtered = [] | |
187 | 188 | if aspect != u'_': |
188 | 189 | for option in options: |
189 | 190 | (orth, tag) = option |
190 | 191 | if in_tag(aspect, tag): |
191 | 192 | filtered.append(option) |
192 | - options = filtered | |
193 | + options = filtered | |
193 | 194 | result += options |
194 | 195 | return dependents(atr, result) |
195 | 196 | |
... | ... |
semantics/views.py
... | ... | @@ -453,7 +453,7 @@ def ajax_roles(request): |
453 | 453 | @render('schemas.json') |
454 | 454 | @ajax(method='get', encode_result=False) |
455 | 455 | def ajax_schemas(request, lemma_id): |
456 | - | |
456 | + | |
457 | 457 | lemma = Lemma.objects.get(id=lemma_id).entry_obj.actual_lemma() |
458 | 458 | |
459 | 459 | schemas_all = lemma.frames.all() |
... | ... | @@ -478,9 +478,11 @@ def ajax_schemas(request, lemma_id): |
478 | 478 | characteristics[characteristic_id] = "(%s)" % (','.join(values[1:])) |
479 | 479 | schemas_by_characteristic[characteristic_id] = [] |
480 | 480 | schemas_by_characteristic[characteristic_id].append(schema) |
481 | - | |
481 | + | |
482 | 482 | lexical_units = lemma.entry_obj.meanings.all() |
483 | 483 | |
484 | + i = 0 | |
485 | + | |
484 | 486 | schemas_display = [] |
485 | 487 | schema_unit_rank = {} |
486 | 488 | for characteristic_id in characteristics_ids: |
... | ... | @@ -488,6 +490,7 @@ def ajax_schemas(request, lemma_id): |
488 | 490 | schemas = schemas_by_characteristic[characteristic_id] |
489 | 491 | |
490 | 492 | for schema in schemas: # row by row display for schema tables |
493 | + | |
491 | 494 | ordered_positions = sort_positions(schema.positions.all()) |
492 | 495 | # classes and first frame/position part of identifiers |
493 | 496 | schema_ids = [u'schema_' + str(schema.id) + '_pos_' + str(position.id) + '_' for position in ordered_positions] |
... | ... | @@ -499,8 +502,8 @@ def ajax_schemas(request, lemma_id): |
499 | 502 | schema_arguments_rowspan = max(max([position.arguments.count() for position in ordered_positions] + [0]), 1) |
500 | 503 | |
501 | 504 | display = {"categories": [{"csv_id": c, "csv_class": c, "argument": a} for c, a in schema_categories], "arguments": []} |
502 | - for i in range(schema_arguments_rowspan): | |
503 | 505 | |
506 | + for i in range(schema_arguments_rowspan): | |
504 | 507 | row = [] |
505 | 508 | idents = [] |
506 | 509 | for schema_id, position in zip(schema_ids, ordered_positions): |
... | ... | @@ -513,7 +516,7 @@ def ajax_schemas(request, lemma_id): |
513 | 516 | idents.append(schema_id + 'arg_-' + str(i + 1) + '_') |
514 | 517 | # identifier, class, argument |
515 | 518 | arg = [] |
516 | - #ma["ala"] = kot | |
519 | + | |
517 | 520 | for i, c, a, p in zip(idents, schema_ids, row, ordered_positions): |
518 | 521 | astr, aobj = a |
519 | 522 | if aobj is not None and aobj.is_phraseologic(): |
... | ... | @@ -523,7 +526,7 @@ def ajax_schemas(request, lemma_id): |
523 | 526 | lex, vrb, loc = ([], [], 0) |
524 | 527 | arg.append({"csv_id": i, "csv_class": c, "argument": astr, "lex": lex, "vrb": vrb, "loc": loc}) |
525 | 528 | display["arguments"].append(arg) |
526 | - | |
529 | + | |
527 | 530 | schema_display["schemas"].append({"schema_id": str(schema.id), "grade": lemma.get_schema_opinion(schema), "colspan": str(max(len(schema_categories), 1)), "rowspan": str(schema_arguments_rowspan), "display": display, "phraseologic": schema.phraseologic}) |
528 | 531 | |
529 | 532 | ranks = FrameRankings.objects.filter(frame=schema) |
... | ... |