Commit bb84d879ab0cc0faf87a0dbf45763f3b9f415675
1 parent
0c1adb0e
Podpinanie wszystkich lexów pod rolę Lemma – do ręcznego tworzenia jednostek
Showing
3 changed files
with
16 additions
and
9 deletions
semantics/static/js/semantics_lexical_units.js
... | ... | @@ -325,10 +325,12 @@ function getFormForLexicalisation(lexicalisation) { |
325 | 325 | var options = []; |
326 | 326 | var i; |
327 | 327 | for (i = 0; i < lexicalisation.length; i++) { |
328 | - var perms = permute(lexicalisation[i].args); | |
329 | - var j; | |
330 | - for (j = 0; j < perms.length; j++) { | |
331 | - options.push({lemma: lexicalisation[i].lemma, pre: lexicalisation[i].pre, post: cartesian(perms[j])}); | |
328 | + if (lexicalisation[i].args.length > 0 || lexicalisation[i].pre.length > 0) { | |
329 | + var perms = permute(lexicalisation[i].args); | |
330 | + var j; | |
331 | + for (j = 0; j < perms.length; j++) { | |
332 | + options.push({lemma: lexicalisation[i].lemma, pre: lexicalisation[i].pre, post: cartesian(perms[j])}); | |
333 | + } | |
332 | 334 | } |
333 | 335 | } |
334 | 336 | result = lexicalisationForm(options); |
... | ... |
semantics/static/js/semantics_schemas.js
... | ... | @@ -118,7 +118,7 @@ function schemaBody(schema, alternation, lex){ |
118 | 118 | schema_body += '<td class="ColumnHeader">Funkcja:</td>'; |
119 | 119 | var display = schema.display; |
120 | 120 | for (k = 0; k < display.categories.length; k++) { |
121 | - schema_body += '<td class="' + display.categories[k].csv_class + 'alt_' + alternation + '_" id="' + display.categories[k].csv_class + 'alt_' + alternation + '_" onclick="schemaClick(\'' + display.categories[k].csv_id + 'alt_' + alternation + '_\', [])">'; | |
121 | + schema_body += '<td class="' + display.categories[k].csv_class + 'alt_' + alternation + '_" id="' + display.categories[k].csv_class + 'alt_' + alternation + '_" onclick="schemaClick(\'' + display.categories[k].csv_id + 'alt_' + alternation + '_\', [], false)">'; | |
122 | 122 | schema_body += display.categories[k].argument; |
123 | 123 | schema_body += '</td>'; |
124 | 124 | position_arguments[display.categories[k].csv_class + 'alt_' + alternation + '_'] = []; |
... | ... | @@ -130,9 +130,14 @@ function schemaBody(schema, alternation, lex){ |
130 | 130 | for (l = 0; l < display.arguments[k].length; l++) { |
131 | 131 | schema_body += '<td id="' + display.arguments[k][l].csv_id + 'alt_' + alternation + '_" class="' + display.arguments[k][l].csv_class + 'alt_' + alternation + '_" onclick="schemaClick(\'' + display.arguments[k][l].csv_id + 'alt_' + alternation +'_\', '; |
132 | 132 | if (display.arguments[k][l].lex.length != 0) { |
133 | - schema_body += '[\'' + display.arguments[k][l].lex.join('\', \'') + '\']'; | |
133 | + schema_body += '[\'' + display.arguments[k][l].lex.join('\', \'') + '\'], '; | |
134 | 134 | } else { |
135 | - schema_body += '[]'; | |
135 | + schema_body += '[], '; | |
136 | + } | |
137 | + if (display.arguments[k][l].argument.includes("lex") || display.arguments[k][l].argument.includes("fixed")) { | |
138 | + schema_body += "true"; | |
139 | + } else { | |
140 | + schema_body += "false"; | |
136 | 141 | } |
137 | 142 | schema_body += ')">'; |
138 | 143 | schema_body += display.arguments[k][l].argument; |
... | ... |
semantics/static/js/semantics_view.js
... | ... | @@ -1469,10 +1469,10 @@ function color(what, how, disconnected_background, disconnected_text) { |
1469 | 1469 | |
1470 | 1470 | } |
1471 | 1471 | |
1472 | -function schemaClick(class_id, lex) { | |
1472 | +function schemaClick(class_id, lex, can_be_lemma) { | |
1473 | 1473 | |
1474 | 1474 | var table = roles_display_table; |
1475 | - if (lex.length != 0){ | |
1475 | + if (can_be_lemma){ | |
1476 | 1476 | table = roles_display_table_full; |
1477 | 1477 | } |
1478 | 1478 | |
... | ... |