Commit f17497dd90aae710e5b9c2bca10fca597433be68

Authored by Katarzyna Krasnowska
1 parent 8c1aa887

added prototype examples display

common/static/common/css/common.css
... ... @@ -15,18 +15,6 @@ main {
15 15 background-color: #e4e4e4;
16 16 }
17 17  
18   -.extra-phrase-types {
19   - border-top: 3px solid #747474;
20   -}
21   -
22   -tr.entry {
23   - font-size: 0.75rem;
24   -}
25   -
26   -legend {
27   - font-size: 1.2rem;
28   -}
29   -
30 18 .tooltip > .tooltip-inner > ul {
31 19 list-style-position: inside;
32 20 padding-left: 0;
... ... @@ -40,89 +28,3 @@ legend {
40 28 .ui-autocomplete {
41 29 z-index: 2000;
42 30 }
43   -
44   -.collapse-button {
45   - float: right;
46   -}
47   -
48   -.remove-button {
49   - float: right;
50   -}
51   -
52   -.remove-or-button {
53   - float: right;
54   -}
55   -
56   -.subform {
57   - border-style: solid;
58   - border-width: 3px;
59   -}
60   -
61   -.form-depth-1 {
62   - background-color: #f2f2f2;
63   - border-color: #e4e4e4;
64   -}
65   -
66   -.form-depth-2 {
67   - background-color: #e4e4e4;
68   - border-color: #d6d6d6;
69   -}
70   -
71   -.form-depth-3 {
72   - background-color: #d6d6d6;
73   - border-color: #c8c8c8;
74   -}
75   -
76   -.form-depth-4 {
77   - background-color: #c8c8c8;
78   - border-color: #bababa;
79   -}
80   -
81   -.form-depth-5 {
82   - background-color: #bababa;
83   - border-color: #acacac;
84   -}
85   -
86   -.form-depth-6 {
87   - background-color: #acacac;
88   - border-color: #9e9e9e;
89   -}
90   -
91   -.form-depth-7 {
92   - background-color: #9e9e9e;
93   - border-color: #909090;
94   -}
95   -
96   -.form-depth-8 {
97   - background-color: #909090;
98   - border-color: #828282;
99   -}
100   -
101   -.form-depth-9 {
102   - background-color: #828282;
103   - border-color: #747474;
104   -}
105   -
106   -.form-depth-10 {
107   - background-color: #747474;
108   - border-color: #666666;
109   -}
110   -
111   -.to-remove {
112   - background-color: #f6ce95;
113   -}
114   -
115   -.to-collapse {
116   - background-color: white;
117   -}
118   -
119   -
120   -.negated {
121   - background-image: url("/static/common/img/negated.png");
122   - background-repeat: repeat;
123   -}
124   -
125   -.form-group {
126   - margin-bottom: 2px;
127   -
128   -}
... ...
common/templates/base.html
... ... @@ -12,7 +12,7 @@
12 12 <title>{% block title %}{% endblock %} – ShellValier</title>
13 13 <link rel="icon" href="/static/common/favicon.ico">
14 14 <link rel="stylesheet" type="text/css" href="https://bootswatch.com/4/lux/bootstrap.min.css">
15   - <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300&display=swap">
  15 + <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;700&display=swap">
16 16 {% block styles %}{% endblock %}
17 17 <link rel="stylesheet" type="text/css" href="{% static 'common/css/font.css' %}">
18 18 <link rel="stylesheet" type="text/css" href="{% static 'common/css/common.css' %}">
... ...
entries/polish_strings.py
... ... @@ -157,3 +157,24 @@ def LEMMA_COOCCUR():
157 157 'concat' : _('szeregowo (bez spójnika)'),
158 158 'coord' : _('koordynacja (ze spójnikiem)'),
159 159 }
  160 +
  161 +def EXAMPLE_SOURCE():
  162 + return {
  163 + 'NKJP0.5M' : _('Korpus Słownika Frekwencyjnego (0,5M segmentów)'),
  164 + 'NKJP1.2M' : _('korpus ręcznie anotowany (1,2M segmentów)'),
  165 + 'NKJP30M' : _('próbka Korpusu IPI PAN (2. wydanie; 30M segmentów)'),
  166 + 'NKJP250M' : _('pełny Korpus IPI PAN (2. wydanie; 250M segmentów)'),
  167 + 'NKJP300M' : _('podkorpus zrównoważony NKJP (300M segmentów)'),
  168 + 'NKJP500M' : _('demo NKJP (wersja 2; 500M segmentów)'),
  169 + 'NKJP1800M' : _('pełny NKJP (1800M segmentów)'),
  170 + 'linguistic_literature' : _('literatura lingwistyczna'),
  171 + 'other_literature' : _('literatura inna'),
  172 + 'own' : _('własny'),
  173 + }
  174 +
  175 +def EXAMPLE_OPINION():
  176 + return {
  177 + 'zły' : _('zły'),
  178 + 'wątpliwy' : _('wątpliwy'),
  179 + 'dobry' : _('dobry'),
  180 + }
... ...
entries/static/entries/css/entries.css
1 1 /*#entries-table {
2 2 max-height: 100%;
3 3 }*/
  4 +
  5 +.extra-phrase-types {
  6 + border-top: 3px solid #747474;
  7 +}
  8 +
  9 +tr.entry {
  10 + font-size: 0.75rem;
  11 +}
  12 +
  13 +legend {
  14 + font-size: 1.2rem;
  15 +}
  16 +
  17 +.example-yes {
  18 + font-weight: 700;
  19 +}
  20 +
  21 +.example-no {
  22 + opacity: 0.4;
  23 + font-style: italic;
  24 +}
  25 +
  26 +.collapse-button {
  27 + float: right;
  28 +}
  29 +
  30 +.remove-button {
  31 + float: right;
  32 +}
  33 +
  34 +.remove-or-button {
  35 + float: right;
  36 +}
  37 +
  38 +.subform {
  39 + border-style: solid;
  40 + border-width: 3px;
  41 +}
  42 +
  43 +.form-depth-1 {
  44 + background-color: #f2f2f2;
  45 + border-color: #e4e4e4;
  46 +}
  47 +
  48 +.form-depth-2 {
  49 + background-color: #e4e4e4;
  50 + border-color: #d6d6d6;
  51 +}
  52 +
  53 +.form-depth-3 {
  54 + background-color: #d6d6d6;
  55 + border-color: #c8c8c8;
  56 +}
  57 +
  58 +.form-depth-4 {
  59 + background-color: #c8c8c8;
  60 + border-color: #bababa;
  61 +}
  62 +
  63 +.form-depth-5 {
  64 + background-color: #bababa;
  65 + border-color: #acacac;
  66 +}
  67 +
  68 +.form-depth-6 {
  69 + background-color: #acacac;
  70 + border-color: #9e9e9e;
  71 +}
  72 +
  73 +.form-depth-7 {
  74 + background-color: #9e9e9e;
  75 + border-color: #909090;
  76 +}
  77 +
  78 +.form-depth-8 {
  79 + background-color: #909090;
  80 + border-color: #828282;
  81 +}
  82 +
  83 +.form-depth-9 {
  84 + background-color: #828282;
  85 + border-color: #747474;
  86 +}
  87 +
  88 +.form-depth-10 {
  89 + background-color: #747474;
  90 + border-color: #666666;
  91 +}
  92 +
  93 +.to-remove {
  94 + background-color: #f6ce95;
  95 +}
  96 +
  97 +.to-collapse {
  98 + background-color: white;
  99 +}
  100 +
  101 +.negated {
  102 + background-image: url("/static/entries/img/negated.png");
  103 + background-repeat: repeat;
  104 +}
  105 +
  106 +.form-group {
  107 + margin-bottom: 2px;
  108 +
  109 +}
... ...
common/static/common/img/negated.png renamed to entries/static/entries/img/negated.png

202 Bytes

entries/static/entries/js/entries.js
... ... @@ -2,6 +2,8 @@
2 2  
3 3 var curr_entry = null;
4 4 var curr_alternations = null;
  5 +var curr_examples = null;
  6 +var curr_examples_by_id = null;
5 7  
6 8 //var syntax_state = { curr_schema : null, curr_example : null, curr_position : null, curr_phrase: null }
7 9  
... ... @@ -351,7 +353,7 @@ function schema2dom(schema) {
351 353 /*for (var k in phrase.arguments) {
352 354 cls += ' argument-' + phrase.arguments[k];
353 355 }*/
354   - phrases_html += '<div class="phrase px-1 py-2' + cls + '" data-phrase_id="' + phrase.id + '">';
  356 + phrases_html += '<div class="phrase px-1 py-2' + cls + '" data-alternation="0" data-phrase_id="' + phrase.id + '">';
355 357 phrases_html += tooltipped_span(phrase.str, phrase.desc) + '</div>';
356 358 }
357 359 // *** and we want to close the <td> here
... ... @@ -470,7 +472,7 @@ function show_semantics(frames, subentries) {
470 472 var frame = $(this);
471 473 if (!frame.hasClass('active')) {
472 474 $(this).addClass('highlight bg-highlight');
473   - show_debug(gettext('Kliknij, aby wyświetlić przykłady dla tej ramy oraz jej powiązanie ze schematami.'));
  475 + show_debug(gettext('Kliknij, aby wyświetlić przykłady dla tej ramy oraz jej realizacje składniowe.'));
474 476 }
475 477 }).mouseleave(function() {
476 478 $(this).removeClass('highlight bg-highlight');
... ... @@ -478,15 +480,30 @@ function show_semantics(frames, subentries) {
478 480 }).click(function() {
479 481 var frame = $(this);
480 482 if (!frame.hasClass('active')) {
481   - $('.frame.active').removeClass('active');
482   - $('.extra-phrase-types').remove();
483   - $('.phrase').removeClass('initiator stimulus condition factor experiencer theme recipient result instrument manner purpose attribute location path time duration measure lemma source foreground background goal');
484   - $('#semantics-schemata').find('.schema').addClass('inactive');
485   - $('#semantics-schemata').find('.schema').show();
486   - frame.addClass('active');
487   - show_alternations(frame);
  483 + select_frame(frame);
488 484 }
489 485 });
  486 + // if there’s one frame, select it immediately
  487 + if ($('.frame').length == 1) {
  488 + select_frame($('.frame').first());
  489 + }
  490 +}
  491 +
  492 +function clear_curr_example() {
  493 + $('.argument').removeClass('example-yes example-no');
  494 + $('.phrase').removeClass('example-yes example-no');
  495 +}
  496 +
  497 +function select_frame(frame) {
  498 + $('.frame.active').removeClass('active');
  499 + $('.extra-phrase-types').remove();
  500 + $('.phrase').removeClass('initiator stimulus condition factor experiencer theme recipient result instrument manner purpose attribute location path time duration measure lemma source foreground background goal');
  501 + clear_curr_example();
  502 + $('#semantics-schemata').find('.schema').addClass('inactive');
  503 + $('#semantics-schemata').find('.schema').show();
  504 + frame.addClass('active');
  505 + show_alternations(frame);
  506 + show_examples(frame);
490 507 }
491 508  
492 509 function show_alternations(frame) {
... ... @@ -499,6 +516,7 @@ function show_alternations(frame) {
499 516 var extra_phrase_row = phrase_row.clone();
500 517 extra_phrase_row.removeClass('alt-0');
501 518 extra_phrase_row.addClass('extra-phrase-types alt-' + (i));
  519 + extra_phrase_row.find('.phrase').attr('data-alternation', i);
502 520 schema.find('tbody').append(extra_phrase_row);
503 521 }
504 522 for (var i in curr_alternations[frame_id][schema_id]) {
... ... @@ -517,7 +535,40 @@ function show_alternations(frame) {
517 535 $('#semantics-schemata').find('.schema.inactive');
518 536 }
519 537  
520   -function get_schemata_and_frames(entry_id) {
  538 +function show_examples(frame) {
  539 + var frame_id = frame.data('frame_id');
  540 + $('#examples-list').empty();
  541 + for (var i in curr_examples) {
  542 + var example = curr_examples[i];
  543 + if (example.frame_ids.includes(frame_id)) {
  544 + $('#examples-list').append('<tr class="example" data-example_id="' + example.id + '"><td class="py-1">' + example.sentence + '</td><td class="py-1">' + example.source + '</td><td class="py-1">' + example.opinion + '</td></tr>');
  545 + }
  546 + }
  547 + $('.example').mouseenter(function() {
  548 + show_debug(gettext('Kliknij, aby wyświetlić argumenty i frazy powiązane z tym przykładem.'));
  549 + }).mouseleave(function() {
  550 + clear_debug();
  551 + }).click(function() {
  552 + clear_curr_example();
  553 + var example = curr_examples_by_id[$(this).data('example_id')];
  554 + frame.find('.argument').each(function() {
  555 + if (example.argument_ids.includes($(this).data('argument_id'))) {
  556 + $(this).addClass('example-yes');
  557 + } else {
  558 + $(this).addClass('example-no');
  559 + }
  560 + });
  561 + $('#semantics-schemata').find('.phrase').each(function() {
  562 + if (example.phrases.includes($(this).data('phrase_id') + '-' + $(this).data('alternation'))) {
  563 + $(this).addClass('example-yes');
  564 + } else {
  565 + $(this).addClass('example-no');
  566 + }
  567 + });
  568 + });
  569 +}
  570 +
  571 +function get_entry(entry_id) {
521 572 clear_entry();
522 573 show_spinner();
523 574 // TODO should this really be done like this?
... ... @@ -531,9 +582,14 @@ function get_schemata_and_frames(entry_id) {
531 582 data : data,
532 583 timeout : 60000,
533 584 success : function(response) {
  585 + curr_alternations = response.alternations;
  586 + curr_examples = response.examples;
  587 + curr_examples_by_id = Object();
  588 + for (var i in curr_examples) {
  589 + curr_examples_by_id[curr_examples[i].id] = curr_examples[i];
  590 + }
534 591 show_syntax(response.subentries);
535 592 show_semantics(response.frames, response.subentries);
536   - curr_alternations = response.alternations;
537 593 // tooltips with phrase descriptions
538 594 $('[data-toggle="tooltip"]').tooltip();
539 595 clear_info();
... ... @@ -558,7 +614,7 @@ function show_entries(entries) {
558 614 $('.entry').click(function() {
559 615 var selected_entry = $(this).data('entry');
560 616 if (selected_entry !== curr_entry) {
561   - get_schemata_and_frames(selected_entry);
  617 + get_entry(selected_entry);
562 618 $('.entry[data-entry="' + curr_entry + '"]').removeClass('table-primary');
563 619 $(this).addClass('table-primary');
564 620 curr_entry = selected_entry;
... ... @@ -577,6 +633,7 @@ function clear_entry() {
577 633 $('#syntax').empty();
578 634 $('#semantics-frames').empty();
579 635 $('#semantics-schemata').empty();
  636 + $('#examples-list').empty();
580 637 }
581 638  
582 639 function serialize_forms(element) {
... ... @@ -607,11 +664,11 @@ $(document).ready(function() {
607 664 clear_results();
608 665  
609 666 $('#id_filter_schema_').change(function() {
610   - get_schemata_and_frames(curr_entry);
  667 + get_entry(curr_entry);
611 668 });
612 669  
613 670 $('#id_filter_frame_').change(function() {
614   - get_schemata_and_frames(curr_entry);
  671 + get_entry(curr_entry);
615 672 });
616 673  
617 674 initialize_main_form();
... ...
entries/templates/entries.html
... ... @@ -10,6 +10,7 @@
10 10 <!-- for autocomplete -->
11 11 <link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
12 12 <!--link rel="stylesheet" type="text/css" href="{% static 'entries/css/panels.css' %}"-->
  13 + <link rel="stylesheet" type="text/css" href="{% static 'entries/css/entries.css' %}">
13 14 <link rel="stylesheet" type="text/css" href="{% static 'common/css/role_colours.css' %}">
14 15 {% endblock %}
15 16  
... ... @@ -46,7 +47,17 @@
46 47 {% include "entry_display.html" %}
47 48 </div>
48 49 <div id="examples-display" class="row h-25 overflow-auto border-top border-primary">
49   - <p class="p-2">Tu będą przykłady.</p>
  50 + <table id="examples-table" class="table table-sm table-hover table-responsive">
  51 + <thead>
  52 + <tr>
  53 + <th scope="col">{% trans "Przykład" %}</th>
  54 + <th scope="col">{% trans "Źródło" %}</th>
  55 + <th scope="col">{% trans "Opinia" %}</th>
  56 + </tr>
  57 + </thead>
  58 + <tbody id="examples-list">
  59 + </tbody>
  60 + </table>
50 61 </div>
51 62 </div>
52 63 </div>
... ...
entries/views.py
... ... @@ -35,7 +35,7 @@ from .forms import (
35 35 SynsetPreferenceFormFactory,
36 36 )
37 37  
38   -from .polish_strings import SCHEMA_OPINION, FRAME_OPINION
  38 +from .polish_strings import SCHEMA_OPINION, FRAME_OPINION, EXAMPLE_SOURCE, EXAMPLE_OPINION
39 39  
40 40 from .phrase_descriptions.descriptions import position_prop_description, phrase_description
41 41  
... ... @@ -205,8 +205,8 @@ def get_entries(request):
205 205 # some entries with an obj,controlee position, >3 frames etc.
206 206 #entries = entries.filter(name__in=('dozwalać', 'dozwolić', 'obiecywać'))
207 207 #entries = entries.filter(subentries__schemata__positions__phrase_types__text_rep__contains='lex')
208   - entries = entries.filter(frames_count__gt=1)
209   - entries = entries.filter(subentries__schema_hooks__alternation__gt=1)
  208 + #entries = entries.filter(frames_count__gt=1)
  209 + #entries = entries.filter(subentries__schema_hooks__alternation__gt=1)
210 210 #entries = entries.filter(subentries__schema_hooks__argument_connections__argument__role__attribute__isnull=False)
211 211 t3 = datetime.datetime.now()
212 212 entries_list = list(entries.values_list('id', 'name', 'status__key'))[:DEBUG_N]
... ... @@ -255,7 +255,7 @@ def get_phrase_desc(phrase, position, negativity):
255 255 negativity=negativity).description
256 256  
257 257  
258   -def schema2dict(schema, phr2arg, negativity):
  258 +def schema2dict(schema, negativity):
259 259 return {
260 260 'opinion' : SCHEMA_OPINION()[schema.opinion.key],
261 261 'id' : str(schema.id),
... ... @@ -268,7 +268,6 @@ def schema2dict(schema, phr2arg, negativity):
268 268 {
269 269 'str' : str(pt),
270 270 'id' : '{}-{}-{}'.format(schema.id, p.id, pt.id),
271   - #'arguments' : list(phr2arg['-'.join(map(str, (schema.id, p.id, pt.id)))]),
272 271 'desc' : get_phrase_desc(pt, p, negativity),
273 272 } for pt in p.phrase_types.all()
274 273 ],
... ... @@ -282,7 +281,7 @@ def get_prefs_list(argument):
282 281 return list(chain.from_iterable(map(list, prefs)))
283 282  
284 283  
285   -def frame2dict(frame, arg2phr):
  284 +def frame2dict(frame):
286 285 return {
287 286 'opinion' : FRAME_OPINION()[frame.opinion.key],
288 287 'id' : str(frame.id),
... ... @@ -292,7 +291,6 @@ def frame2dict(frame, arg2phr):
292 291 'id' : '{}-{}'.format(frame.id, a.id),
293 292 'role' : '{}{}'.format(a.role.role.role.lower(), ' ' + a.role.attribute.attribute.lower() if a.role.attribute else ''),
294 293 'preferences' : list(map(str, get_prefs_list(a))),
295   - #'phrases' : list(arg2phr['-'.join(map(str, (frame.id, a.id)))]),
296 294 } for a in sorted(frame.arguments.all(), key=lambda a: a.role.role.priority + (a.role.attribute.priority if a.role.attribute else 2))
297 295 ],
298 296 }
... ... @@ -312,26 +310,45 @@ def get_alternations(schemata, frames):
312 310 # TODO czy alternacja może być podpięta do całej pozycji, bez konkretnej frazy?
313 311 alternations = defaultdict(lambda: defaultdict(lambda: defaultdict(lambda: defaultdict(list))))
314 312 for schema in schemata:
315   - print(schema)
316 313 for hook in schema.schema_hooks.all():
317 314 arg_conns = hook.argument_connections.all()
318   - assert(len(arg_conns) == 1)
319   - argument = arg_conns[0].argument
320   - frame = argument.frame
321   - if frame not in frames:
322   - continue
323   - phr_id = '{}-{}-{}'.format(schema.id, hook.position.id, hook.phrase_type.id)
324   - arg_id = '{}-{}'.format(frame.id, argument.id)
325   - alternations[frame.id][schema.id][hook.alternation][arg_id].append(phr_id)
  315 + assert (len(arg_conns) < 2)
  316 + if (arg_conns):
  317 + argument = arg_conns[0].argument
  318 + frame = argument.frame
  319 + if frame not in frames:
  320 + continue
  321 + phr_id = '{}-{}-{}'.format(schema.id, hook.position.id, hook.phrase_type.id)
  322 + arg_id = '{}-{}'.format(frame.id, argument.id)
  323 + alternations[frame.id][schema.id][hook.alternation][arg_id].append(phr_id)
326 324 alt_dict = defaultdict(lambda: defaultdict(list))
327   - #alternations = { frame_id : [frame_alts[alt_no] for alt_no in sorted(frame_alts.keys())] for frame_id, frame_alts in alternations.items() }
328 325 for frame_id, frame_schema_alternations in alternations.items():
329 326 for schema_id, schema_alternations in frame_schema_alternations.items():
330   - print(frame_id, schema_id)
331 327 for alt_no in sorted(schema_alternations.keys()):
332 328 alt_dict[frame_id][schema_id].append(schema_alternations[alt_no])
333 329 return alt_dict
334 330  
  331 +def get_examples(entry):
  332 + examples = []
  333 + for example in entry.examples.all():
  334 + frame_ids, argument_ids, phrases = set(), set(), set()
  335 + for connection in example.example_connections.all():
  336 + for argument in connection.arguments.all():
  337 + frame_ids.add(argument.frame.id)
  338 + argument_ids.add('{}-{}'.format(argument.frame.id, argument.id))
  339 + for hook in connection.schema_connections.all():
  340 + phrases.add('{}-{}-{}-{}'.format(hook.schema.id, hook.position.id, hook.phrase_type.id, hook.alternation - 1))
  341 + examples.append({
  342 + 'id' : str(example.id),
  343 + 'sentence' : example.sentence,
  344 + 'source' : EXAMPLE_SOURCE()[example.source.key],
  345 + 'opinion' : EXAMPLE_OPINION()[example.opinion.key],
  346 + 'frame_ids' : sorted(frame_ids),
  347 + 'argument_ids' : sorted(argument_ids),
  348 + 'phrases' : sorted(phrases),
  349 + })
  350 + return sorted(examples, key=lambda x: x['sentence'])
  351 +
335 352 @ajax_required
336 353 def get_entry(request):
337 354 if request.method == 'POST':
... ... @@ -340,16 +357,6 @@ def get_entry(request):
340 357 if eid.isdigit() and form.is_valid():
341 358 eid = int(eid)
342 359 entry = Entry.objects.get(id=eid)
343   - #===================================================================
344   - phr2arg, arg2phr = defaultdict(set), defaultdict(set)
345   - connections = ArgumentConnection.objects.filter(schema_connections__subentry__entry=entry)
346   - for conn in connections:
347   - arg = '-'.join(map(str, (conn.argument.frame.id, conn.argument.id)))
348   - for hook in conn.schema_connections.all():
349   - phr = '-'.join(map(str, (hook.schema.id, hook.position.id, hook.phrase_type.id)))
350   - phr2arg[phr].add(arg)
351   - arg2phr[arg].add(phr)
352   - #===================================================================
353 360  
354 361 entry_form, children_forms = collect_forms(request.POST['forms[]'])
355 362 filter_schemata, filter_frames = entry_form.cleaned_data['filter_schemata'], entry_form.cleaned_data['filter_frames']
... ... @@ -376,14 +383,15 @@ def get_entry(request):
376 383 if filter_schemata:
377 384 schema_objects = get_filtered_objects2(schema_objects, schema_forms)
378 385 for schema in schema_objects:
379   - schemata.append(schema2dict(schema, phr2arg, subentry.negativity))
  386 + schemata.append(schema2dict(schema, subentry.negativity))
380 387 if schemata:
381 388 all_schema_objects += list(schema_objects)
382 389 subentries.append({ 'str' : subentry2str(subentry), 'schemata' : schemata })
383 390 frame_objects = Frame.objects.filter(arguments__argument_connections__schema_connections__subentry__entry=entry).distinct()
384 391 if filter_frames:
385 392 frame_objects = get_filtered_objects2(frame_objects, frame_forms)
386   - frames = [frame2dict(frame, arg2phr) for frame in frame_objects]
  393 + frames = [frame2dict(frame) for frame in frame_objects]
387 394 alternations = get_alternations(all_schema_objects, frame_objects)
388   - return JsonResponse({ 'subentries' : subentries, 'frames' : frames, 'alternations' : alternations })
  395 + examples = get_examples(entry)
  396 + return JsonResponse({ 'subentries' : subentries, 'frames' : frames, 'alternations' : alternations, 'examples' : examples })
389 397 return JsonResponse({})
... ...
locale/en/LC_MESSAGES/django.mo
No preview for this file type
locale/en/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2020-10-14 16:24+0200\n"
  11 +"POT-Creation-Date: 2020-10-19 15:12+0200\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -18,27 +18,27 @@ msgstr &quot;&quot;
18 18 "Content-Transfer-Encoding: 8bit\n"
19 19 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20 20  
21   -#: common/templates/base.html:42
  21 +#: common/templates/base.html:44
22 22 msgid "Hasła"
23 23 msgstr "Entries"
24 24  
25   -#: common/templates/base.html:47
  25 +#: common/templates/base.html:49
26 26 msgid "Typy fraz"
27 27 msgstr "Phrase types"
28 28  
29   -#: common/templates/base.html:52
  29 +#: common/templates/base.html:54
30 30 msgid "Statystyki"
31 31 msgstr "Statistics"
32 32  
33   -#: common/templates/base.html:57
  33 +#: common/templates/base.html:59
34 34 msgid "Pobierz słownik"
35 35 msgstr "Download dictionary"
36 36  
37   -#: common/templates/base.html:76
  37 +#: common/templates/base.html:78
38 38 msgid "EN"
39 39 msgstr "PL"
40 40  
41   -#: entries/form_fields/specialised_fields.py:41 entries/forms.py:504
  41 +#: entries/form_fields/specialised_fields.py:41 entries/forms.py:505
42 42 msgid "Typ frazeologizmu"
43 43 msgstr "Phraseologism type"
44 44  
... ... @@ -46,7 +46,7 @@ msgstr &quot;Phraseologism type&quot;
46 46 msgid "Typ frazy"
47 47 msgstr "Phrase type"
48 48  
49   -#: entries/form_fields/specialised_fields.py:50
  49 +#: entries/form_fields/specialised_fields.py:50 entries/forms.py:593
50 50 msgid "wybierz"
51 51 msgstr "choose"
52 52  
... ... @@ -74,8 +74,8 @@ msgstr &quot;Or&quot;
74 74 msgid "Schemat"
75 75 msgstr "Schema"
76 76  
77   -#: entries/forms.py:145 entries/forms.py:438 entries/forms.py:598
78   -#: entries/forms.py:712 entries/forms.py:714 entries/forms.py:716
  77 +#: entries/forms.py:145 entries/forms.py:439 entries/forms.py:605
  78 +#: entries/forms.py:719 entries/forms.py:721 entries/forms.py:723
79 79 msgid "Fraza"
80 80 msgstr "Phrase"
81 81  
... ... @@ -103,8 +103,8 @@ msgstr &quot;Filter&quot;
103 103 msgid "Wyczyść"
104 104 msgstr "Reset"
105 105  
106   -#: entries/forms.py:166 entries/forms.py:454 entries/forms.py:460
107   -#: entries/forms.py:499
  106 +#: entries/forms.py:166 entries/forms.py:455 entries/forms.py:461
  107 +#: entries/forms.py:500
108 108 msgid "Lemat"
109 109 msgstr "Lemma"
110 110  
... ... @@ -144,159 +144,159 @@ msgstr &quot;Remove&quot;
144 144 msgid "Zaneguj"
145 145 msgstr "Negate"
146 146  
147   -#: entries/forms.py:283
  147 +#: entries/forms.py:284
148 148 msgid "Schemat składniowy"
149 149 msgstr "Syntactic schema"
150 150  
151   -#: entries/forms.py:289
  151 +#: entries/forms.py:290
152 152 msgid "Opinia o schemacie"
153 153 msgstr "Schema opinion"
154 154  
155   -#: entries/forms.py:301
  155 +#: entries/forms.py:302
156 156 msgid "Typ"
157 157 msgstr "Type"
158 158  
159   -#: entries/forms.py:303
  159 +#: entries/forms.py:304
160 160 msgid "zwykły"
161 161 msgstr "ordinary"
162 162  
163   -#: entries/forms.py:304
  163 +#: entries/forms.py:305
164 164 msgid "frazeologiczny"
165 165 msgstr "phraseological"
166 166  
167   -#: entries/forms.py:313
  167 +#: entries/forms.py:314
168 168 msgid "Zwrotność"
169 169 msgstr "Reflexiveness"
170 170  
171   -#: entries/forms.py:386 entries/forms.py:593
  171 +#: entries/forms.py:387 entries/forms.py:600
172 172 msgid "Pozycja"
173 173 msgstr "Position"
174 174  
175   -#: entries/forms.py:402
  175 +#: entries/forms.py:403
176 176 msgid "Pozycja składniowa"
177 177 msgstr "Syntactic position"
178 178  
179   -#: entries/forms.py:408
  179 +#: entries/forms.py:409
180 180 msgid "Funkcja gramatyczna"
181 181 msgstr "Grammatical function"
182 182  
183   -#: entries/forms.py:418
  183 +#: entries/forms.py:419
184 184 msgid "Kontrola"
185 185 msgstr "Control"
186 186  
187   -#: entries/forms.py:428
  187 +#: entries/forms.py:429
188 188 msgid "Kontrola predykatywna"
189 189 msgstr "Predicative control"
190 190  
191   -#: entries/forms.py:437
  191 +#: entries/forms.py:438
192 192 msgid "Typ frazy występujący na pozycji."
193 193 msgstr ""
194 194  
195   -#: entries/forms.py:474
  195 +#: entries/forms.py:475
196 196 msgid "Frazeologizm"
197 197 msgstr "Phraseologism"
198 198  
199   -#: entries/forms.py:480
  199 +#: entries/forms.py:481
200 200 msgid "Wybór lematów"
201 201 msgstr "Lemma choice"
202 202  
203   -#: entries/forms.py:490
  203 +#: entries/forms.py:491
204 204 msgid "Łączenie lematów"
205 205 msgstr "Lemma joining"
206 206  
207   -#: entries/forms.py:503 entries/forms.py:742
  207 +#: entries/forms.py:504 entries/forms.py:749
208 208 msgid "Typ składniowy frazeologizmu."
209 209 msgstr ""
210 210  
211   -#: entries/forms.py:522
  211 +#: entries/forms.py:523
212 212 msgid "Rama semantyczna"
213 213 msgstr "Semantic frame"
214 214  
215   -#: entries/forms.py:528
  215 +#: entries/forms.py:529 entries/templates/entries.html:55
216 216 msgid "Opinia"
217 217 msgstr "Opinion"
218 218  
219   -#: entries/forms.py:538
  219 +#: entries/forms.py:539
220 220 msgid "Liczba argumentów"
221 221 msgstr "Number of arguments"
222 222  
223   -#: entries/forms.py:545
  223 +#: entries/forms.py:546
224 224 msgid "Liczba preferencyj selekcyjnych argumentu"
225 225 msgstr "Number of argument’s selectional preferences"
226 226  
227   -#: entries/forms.py:551
  227 +#: entries/forms.py:552
228 228 msgid "Argument"
229 229 msgstr "Argument"
230 230  
231   -#: entries/forms.py:561
  231 +#: entries/forms.py:568
232 232 msgid "Argument semantyczny"
233 233 msgstr "Semantic argument"
234 234  
235   -#: entries/forms.py:567
  235 +#: entries/forms.py:574
236 236 msgid "Rola"
237 237 msgstr "Role"
238 238  
239   -#: entries/forms.py:576
  239 +#: entries/forms.py:583
240 240 msgid "Atrybut roli"
241 241 msgstr "Role attribute"
242 242  
243   -#: entries/forms.py:585 entries/forms.py:589
  243 +#: entries/forms.py:592 entries/forms.py:596
244 244 msgid "Preferencja selekcyjna"
245 245 msgstr "Selectional preference"
246 246  
247   -#: entries/forms.py:586
  247 +#: entries/forms.py:593
248 248 msgid "Predefiniowana grupa znaczeń"
249 249 msgstr "Predefined meanings class"
250 250  
251   -#: entries/forms.py:586
  251 +#: entries/forms.py:593
252 252 msgid "Wyrażona przez relację"
253 253 msgstr "Expressed by relation"
254 254  
255   -#: entries/forms.py:586
  255 +#: entries/forms.py:593
256 256 msgid "Wyrażona przez jednostkę leksykalną Słowosieci"
257 257 msgstr "Expressed by plWordnet lexical unit"
258 258  
259   -#: entries/forms.py:597
  259 +#: entries/forms.py:604
260 260 msgid "Typ frazy, przez którą może być realizowany argument."
261 261 msgstr ""
262 262  
263   -#: entries/forms.py:608
  263 +#: entries/forms.py:615
264 264 msgid "Preferencja predefiniowana"
265 265 msgstr "Predefined preference"
266 266  
267   -#: entries/forms.py:629
  267 +#: entries/forms.py:636
268 268 msgid "Preferencja – relacja"
269 269 msgstr "Relational preference"
270 270  
271   -#: entries/forms.py:635
  271 +#: entries/forms.py:642
272 272 msgid "Relacja"
273 273 msgstr "Relation"
274 274  
275   -#: entries/forms.py:645
  275 +#: entries/forms.py:652
276 276 msgid "Do: rola"
277 277 msgstr "To: role"
278 278  
279   -#: entries/forms.py:654
  279 +#: entries/forms.py:661
280 280 msgid "Do: atrybut"
281 281 msgstr "To: attribute"
282 282  
283   -#: entries/forms.py:669
  283 +#: entries/forms.py:676
284 284 msgid "Preferencja – Słowosieć"
285 285 msgstr "plWordnet preference"
286 286  
287   -#: entries/forms.py:675
  287 +#: entries/forms.py:682
288 288 msgid "Jednostka leksykalna"
289 289 msgstr "Lexical unit"
290 290  
291   -#: entries/forms.py:723 entries/polish_strings.py:124
  291 +#: entries/forms.py:730 entries/polish_strings.py:124
292 292 msgid "frazeologizm"
293 293 msgstr "phraseologism"
294 294  
295   -#: entries/forms.py:738
  295 +#: entries/forms.py:745
296 296 msgid "Fraza składowa frazeologizmu porównawczego."
297 297 msgstr ""
298 298  
299   -#: entries/forms.py:740
  299 +#: entries/forms.py:747
300 300 msgid "Fraza realizująca frazeologizm."
301 301 msgstr ""
302 302  
... ... @@ -388,11 +388,11 @@ msgstr &quot;colloquial&quot;
388 388 msgid "archaiczny"
389 389 msgstr "archaic"
390 390  
391   -#: entries/polish_strings.py:22
  391 +#: entries/polish_strings.py:22 entries/polish_strings.py:177
392 392 msgid "zły"
393 393 msgstr "bad"
394 394  
395   -#: entries/polish_strings.py:23
  395 +#: entries/polish_strings.py:23 entries/polish_strings.py:178
396 396 msgid "wątpliwy"
397 397 msgstr "uncertain"
398 398  
... ... @@ -786,11 +786,63 @@ msgstr &quot;concatenation (no conjunction)&quot;
786 786 msgid "koordynacja (ze spójnikiem)"
787 787 msgstr "coordination (with conjunction)"
788 788  
789   -#: entries/templates/entries.html:37
  789 +#: entries/polish_strings.py:163
  790 +msgid "Korpus Słownika Frekwencyjnego (0,5M segmentów)"
  791 +msgstr "Frequency Dictionary Corpus (0.5M segments)"
  792 +
  793 +#: entries/polish_strings.py:164
  794 +msgid "korpus ręcznie anotowany (1,2M segmentów)"
  795 +msgstr "manually annotated corpus (1.2M segments)"
  796 +
  797 +#: entries/polish_strings.py:165
  798 +msgid "próbka Korpusu IPI PAN (2. wydanie; 30M segmentów)"
  799 +msgstr "IPI PAN Corpus sample (2nd edition; 30M segments)"
  800 +
  801 +#: entries/polish_strings.py:166
  802 +msgid "pełny Korpus IPI PAN (2. wydanie; 250M segmentów)"
  803 +msgstr "full IPI PAN Corpus (2nd edition; 250M segments)"
  804 +
  805 +#: entries/polish_strings.py:167
  806 +msgid "podkorpus zrównoważony NKJP (300M segmentów)"
  807 +msgstr "balanced NKJP subcorpus (300M segments)"
  808 +
  809 +#: entries/polish_strings.py:168
  810 +msgid "demo NKJP (wersja 2; 500M segmentów)"
  811 +msgstr "demo NKJP (version 2; 500M segments)"
  812 +
  813 +#: entries/polish_strings.py:169
  814 +msgid "pełny NKJP (1800M segmentów)"
  815 +msgstr "full NKJP (1800M segments)"
  816 +
  817 +#: entries/polish_strings.py:170
  818 +msgid "literatura lingwistyczna"
  819 +msgstr "linguistic literature"
  820 +
  821 +#: entries/polish_strings.py:171
  822 +msgid "literatura inna"
  823 +msgstr "other literature"
  824 +
  825 +#: entries/polish_strings.py:172
  826 +msgid "własny"
  827 +msgstr "own"
  828 +
  829 +#: entries/polish_strings.py:179
  830 +msgid "dobry"
  831 +msgstr "good"
  832 +
  833 +#: entries/templates/entries.html:39
790 834 msgid "Filtrowanie"
791 835 msgstr "Filtering"
792 836  
793   -#: entries/templates/entries.html:57
  837 +#: entries/templates/entries.html:53
  838 +msgid "Przykład"
  839 +msgstr "Example"
  840 +
  841 +#: entries/templates/entries.html:54
  842 +msgid "Źródło"
  843 +msgstr "Source"
  844 +
  845 +#: entries/templates/entries.html:69
794 846 msgid "Filtrowanie haseł"
795 847 msgstr "Entry filtering"
796 848  
... ...
locale/en/LC_MESSAGES/djangojs.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2020-10-14 16:24+0200\n"
  11 +"POT-Creation-Date: 2020-10-19 15:12+0200\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -18,54 +18,68 @@ msgstr &quot;&quot;
18 18 "Content-Transfer-Encoding: 8bit\n"
19 19 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20 20  
21   -#: entries/static/entries/js/entries.js:60
  21 +#: entries/static/entries/js/entries.js:63
22 22 msgid "Formularz filtrowania zawiera błędy."
23 23 msgstr "The filtering form contains errors."
24 24  
25   -#: entries/static/entries/js/entries.js:101
  25 +#: entries/static/entries/js/entries.js:104
26 26 msgid "zwiń"
27 27 msgstr "collapse"
28 28  
29   -#: entries/static/entries/js/entries.js:106
  29 +#: entries/static/entries/js/entries.js:109
30 30 msgid "rozwiń"
31 31 msgstr "expand"
32 32  
33   -#: entries/static/entries/js/entries.js:143
  33 +#: entries/static/entries/js/entries.js:146
34 34 msgid "LUB"
35 35 msgstr "OR"
36 36  
37   -#: entries/static/entries/js/entries.js:143
  37 +#: entries/static/entries/js/entries.js:146
38 38 msgid "Usuń"
39 39 msgstr "Remove"
40 40  
41   -#: entries/static/entries/js/entries.js:300
  41 +#: entries/static/entries/js/entries.js:303
42 42 msgid "Opinia"
43 43 msgstr "Opinion"
44 44  
45   -#: entries/static/entries/js/entries.js:323
  45 +#: entries/static/entries/js/entries.js:327
46 46 msgid "Funkcja"
47 47 msgstr "Function"
48 48  
49   -#: entries/static/entries/js/entries.js:325
  49 +#: entries/static/entries/js/entries.js:330
50 50 msgid "Typy fraz"
51 51 msgstr "Phrase types"
52 52  
53   -#: entries/static/entries/js/entries.js:385
  53 +#: entries/static/entries/js/entries.js:390
54 54 msgid "brak schematów"
55 55 msgstr "no schemata"
56 56  
57   -#: entries/static/entries/js/entries.js:415
  57 +#: entries/static/entries/js/entries.js:401
  58 +msgid "Kliknij, aby wyświetlić przykłady dla tego schematu."
  59 +msgstr "Click to show examples for this schema."
  60 +
  61 +#: entries/static/entries/js/entries.js:421
58 62 msgid "Rola"
59 63 msgstr "Role"
60 64  
61   -#: entries/static/entries/js/entries.js:417
  65 +#: entries/static/entries/js/entries.js:423
62 66 msgid "Preferencje selekcyjne"
63 67 msgstr "Selectional preferences"
64 68  
65   -#: entries/static/entries/js/entries.js:454
  69 +#: entries/static/entries/js/entries.js:460
66 70 msgid "brak ram"
67 71 msgstr "no frames"
68 72  
69   -#: entries/static/entries/js/entries.js:501
  73 +#: entries/static/entries/js/entries.js:475
  74 +msgid ""
  75 +"Kliknij, aby wyświetlić przykłady dla tej ramy oraz jej realizacje "
  76 +"składniowe."
  77 +msgstr "Click to show examples for this frame and its syntactic realisations."
  78 +
  79 +#: entries/static/entries/js/entries.js:541
  80 +msgid "Kliknij, aby wyświetlić argumenty i frazy powiązane z tym przykładem."
  81 +msgstr "Click to show arguments and phrases in this example."
  82 +
  83 +#: entries/static/entries/js/entries.js:590
70 84 msgid "brak haseł"
71 85 msgstr "no entries"
... ...