Commit b9c876d092d2f4d469c6b578b7324036ad7de01c

Authored by Katarzyna Krasnowska
1 parent 4a1cf35d

* added preliminary frame colouring

* adjusted role/attribute priority & argument sorting
* switched to a more condensed font (Roboto Condensed)
* added saving Entry after storing Semantics -> frames # gets saved
* fixes & code cleanup
common/static/common/css/common.css
... ... @@ -15,6 +15,10 @@ main {
15 15 border-color: #b0c4d9;
16 16 }
17 17  
  18 +.bg-highlight {
  19 + background-color: #e4e4e4;
  20 +}
  21 +
18 22 tr.entry {
19 23 font-size: 0.75rem;
20 24 }
... ...
common/static/common/css/font.css 0 → 100644
  1 +:root {
  2 + --font-family-sans-serif: 'Roboto Condensed', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  3 + --font-family-monospace: 'Roboto Condensed', SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace
  4 +}
  5 +
  6 +html {
  7 + font-family: 'Roboto Condensed'
  8 +}
  9 +
  10 +body {
  11 + font-family: 'Roboto Condensed', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"
  12 +}
  13 +
  14 +pre,code,kbd,samp {
  15 + font-family: 'Roboto Condensed', SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace
  16 +}
  17 +
  18 +.tooltip {
  19 + font-family: 'Roboto Condensed', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"
  20 +}
  21 +
  22 +.popover {
  23 + font-family: 'Roboto Condensed', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"
  24 +}
... ...
common/static/common/css/role_colours.css 0 → 100644
  1 +.frame.highlight .initiator {
  2 + background-color: rgb(173, 181, 237);
  3 +}
  4 +
  5 +.frame.active .initiator {
  6 + background-color: rgb(91, 106, 217);
  7 +}
  8 +
  9 +.frame.highlight .initiator.source {
  10 + background: linear-gradient(to left, rgba(173, 181, 237, 0.1), rgb(173, 181, 237)) repeat scroll 0% 0%;
  11 +}
  12 +
  13 +.frame.active .initiator.source {
  14 + background: linear-gradient(to left, rgba(91, 106, 217, 0.1), rgb(91, 106, 217)) repeat scroll 0% 0%;
  15 +}
  16 +
  17 +.frame.highlight .initiator.foreground {
  18 + background: linear-gradient(to top, rgba(173, 181, 237, 0.1), rgb(173, 181, 237)) repeat scroll 0% 0%;
  19 +}
  20 +
  21 +.frame.active .initiator.foreground {
  22 + background: linear-gradient(to top, rgba(91, 106, 217, 0.1), rgb(91, 106, 217)) repeat scroll 0% 0%;
  23 +}
  24 +
  25 +.frame.highlight .initiator.background {
  26 + background: linear-gradient(to bottom, rgba(173, 181, 237, 0.1), rgb(173, 181, 237)) repeat scroll 0% 0%;
  27 +}
  28 +
  29 +.frame.active .initiator.background {
  30 + background: linear-gradient(to bottom, rgba(91, 106, 217, 0.1), rgb(91, 106, 217)) repeat scroll 0% 0%;
  31 +}
  32 +
  33 +.frame.highlight .initiator.goal {
  34 + background: linear-gradient(to right, rgba(173, 181, 237, 0.1), rgb(173, 181, 237)) repeat scroll 0% 0%;
  35 +}
  36 +
  37 +.frame.active .initiator.goal {
  38 + background: linear-gradient(to right, rgba(91, 106, 217, 0.1), rgb(91, 106, 217)) repeat scroll 0% 0%;
  39 +}
  40 +
  41 +.frame.highlight .stimulus {
  42 + background-color: rgb(159, 215, 241);
  43 +}
  44 +
  45 +.frame.active .stimulus {
  46 + background-color: rgb(62, 173, 226);
  47 +}
  48 +
  49 +.frame.highlight .stimulus.source {
  50 + background: linear-gradient(to left, rgba(159, 215, 241, 0.1), rgb(159, 215, 241)) repeat scroll 0% 0%;
  51 +}
  52 +
  53 +.frame.active .stimulus.source {
  54 + background: linear-gradient(to left, rgba(62, 173, 226, 0.1), rgb(62, 173, 226)) repeat scroll 0% 0%;
  55 +}
  56 +
  57 +.frame.highlight .stimulus.foreground {
  58 + background: linear-gradient(to top, rgba(159, 215, 241, 0.1), rgb(159, 215, 241)) repeat scroll 0% 0%;
  59 +}
  60 +
  61 +.frame.active .stimulus.foreground {
  62 + background: linear-gradient(to top, rgba(62, 173, 226, 0.1), rgb(62, 173, 226)) repeat scroll 0% 0%;
  63 +}
  64 +
  65 +.frame.highlight .stimulus.background {
  66 + background: linear-gradient(to bottom, rgba(159, 215, 241, 0.1), rgb(159, 215, 241)) repeat scroll 0% 0%;
  67 +}
  68 +
  69 +.frame.active .stimulus.background {
  70 + background: linear-gradient(to bottom, rgba(62, 173, 226, 0.1), rgb(62, 173, 226)) repeat scroll 0% 0%;
  71 +}
  72 +
  73 +.frame.highlight .stimulus.goal {
  74 + background: linear-gradient(to right, rgba(159, 215, 241, 0.1), rgb(159, 215, 241)) repeat scroll 0% 0%;
  75 +}
  76 +
  77 +.frame.active .stimulus.goal {
  78 + background: linear-gradient(to right, rgba(62, 173, 226, 0.1), rgb(62, 173, 226)) repeat scroll 0% 0%;
  79 +}
  80 +
  81 +.frame.highlight .condition {
  82 + background-color: rgb(191, 227, 225);
  83 +}
  84 +
  85 +.frame.active .condition {
  86 + background-color: rgb(127, 199, 195);
  87 +}
  88 +
  89 +.frame.highlight .condition.source {
  90 + background: linear-gradient(to left, rgba(191, 227, 225, 0.1), rgb(191, 227, 225)) repeat scroll 0% 0%;
  91 +}
  92 +
  93 +.frame.active .condition.source {
  94 + background: linear-gradient(to left, rgba(127, 199, 195, 0.1), rgb(127, 199, 195)) repeat scroll 0% 0%;
  95 +}
  96 +
  97 +.frame.highlight .condition.foreground {
  98 + background: linear-gradient(to top, rgba(191, 227, 225, 0.1), rgb(191, 227, 225)) repeat scroll 0% 0%;
  99 +}
  100 +
  101 +.frame.active .condition.foreground {
  102 + background: linear-gradient(to top, rgba(127, 199, 195, 0.1), rgb(127, 199, 195)) repeat scroll 0% 0%;
  103 +}
  104 +
  105 +.frame.highlight .condition.background {
  106 + background: linear-gradient(to bottom, rgba(191, 227, 225, 0.1), rgb(191, 227, 225)) repeat scroll 0% 0%;
  107 +}
  108 +
  109 +.frame.active .condition.background {
  110 + background: linear-gradient(to bottom, rgba(127, 199, 195, 0.1), rgb(127, 199, 195)) repeat scroll 0% 0%;
  111 +}
  112 +
  113 +.frame.highlight .condition.goal {
  114 + background: linear-gradient(to right, rgba(191, 227, 225, 0.1), rgb(191, 227, 225)) repeat scroll 0% 0%;
  115 +}
  116 +
  117 +.frame.active .condition.goal {
  118 + background: linear-gradient(to right, rgba(127, 199, 195, 0.1), rgb(127, 199, 195)) repeat scroll 0% 0%;
  119 +}
  120 +
  121 +.frame.highlight .factor {
  122 + background-color: rgb(169, 203, 171);
  123 +}
  124 +
  125 +.frame.active .factor {
  126 + background-color: rgb(82, 150, 87);
  127 +}
  128 +
  129 +.frame.highlight .factor.source {
  130 + background: linear-gradient(to left, rgba(169, 203, 171, 0.1), rgb(169, 203, 171)) repeat scroll 0% 0%;
  131 +}
  132 +
  133 +.frame.active .factor.source {
  134 + background: linear-gradient(to left, rgba(82, 150, 87, 0.1), rgb(82, 150, 87)) repeat scroll 0% 0%;
  135 +}
  136 +
  137 +.frame.highlight .factor.foreground {
  138 + background: linear-gradient(to top, rgba(169, 203, 171, 0.1), rgb(169, 203, 171)) repeat scroll 0% 0%;
  139 +}
  140 +
  141 +.frame.active .factor.foreground {
  142 + background: linear-gradient(to top, rgba(82, 150, 87, 0.1), rgb(82, 150, 87)) repeat scroll 0% 0%;
  143 +}
  144 +
  145 +.frame.highlight .factor.background {
  146 + background: linear-gradient(to bottom, rgba(169, 203, 171, 0.1), rgb(169, 203, 171)) repeat scroll 0% 0%;
  147 +}
  148 +
  149 +.frame.active .factor.background {
  150 + background: linear-gradient(to bottom, rgba(82, 150, 87, 0.1), rgb(82, 150, 87)) repeat scroll 0% 0%;
  151 +}
  152 +
  153 +.frame.highlight .factor.goal {
  154 + background: linear-gradient(to right, rgba(169, 203, 171, 0.1), rgb(169, 203, 171)) repeat scroll 0% 0%;
  155 +}
  156 +
  157 +.frame.active .factor.goal {
  158 + background: linear-gradient(to right, rgba(82, 150, 87, 0.1), rgb(82, 150, 87)) repeat scroll 0% 0%;
  159 +}
  160 +
  161 +.frame.highlight .experiencer {
  162 + background-color: rgb(203, 225, 171);
  163 +}
  164 +
  165 +.frame.active .experiencer {
  166 + background-color: rgb(149, 195, 86);
  167 +}
  168 +
  169 +.frame.highlight .experiencer.source {
  170 + background: linear-gradient(to left, rgba(203, 225, 171, 0.1), rgb(203, 225, 171)) repeat scroll 0% 0%;
  171 +}
  172 +
  173 +.frame.active .experiencer.source {
  174 + background: linear-gradient(to left, rgba(149, 195, 86, 0.1), rgb(149, 195, 86)) repeat scroll 0% 0%;
  175 +}
  176 +
  177 +.frame.highlight .experiencer.foreground {
  178 + background: linear-gradient(to top, rgba(203, 225, 171, 0.1), rgb(203, 225, 171)) repeat scroll 0% 0%;
  179 +}
  180 +
  181 +.frame.active .experiencer.foreground {
  182 + background: linear-gradient(to top, rgba(149, 195, 86, 0.1), rgb(149, 195, 86)) repeat scroll 0% 0%;
  183 +}
  184 +
  185 +.frame.highlight .experiencer.background {
  186 + background: linear-gradient(to bottom, rgba(203, 225, 171, 0.1), rgb(203, 225, 171)) repeat scroll 0% 0%;
  187 +}
  188 +
  189 +.frame.active .experiencer.background {
  190 + background: linear-gradient(to bottom, rgba(149, 195, 86, 0.1), rgb(149, 195, 86)) repeat scroll 0% 0%;
  191 +}
  192 +
  193 +.frame.highlight .experiencer.goal {
  194 + background: linear-gradient(to right, rgba(203, 225, 171, 0.1), rgb(203, 225, 171)) repeat scroll 0% 0%;
  195 +}
  196 +
  197 +.frame.active .experiencer.goal {
  198 + background: linear-gradient(to right, rgba(149, 195, 86, 0.1), rgb(149, 195, 86)) repeat scroll 0% 0%;
  199 +}
  200 +
  201 +.frame.highlight .theme {
  202 + background-color: rgb(173, 217, 163);
  203 +}
  204 +
  205 +.frame.active .theme {
  206 + background-color: rgb(90, 179, 69);
  207 +}
  208 +
  209 +.frame.highlight .theme.source {
  210 + background: linear-gradient(to left, rgba(173, 217, 163, 0.1), rgb(173, 217, 163)) repeat scroll 0% 0%;
  211 +}
  212 +
  213 +.frame.active .theme.source {
  214 + background: linear-gradient(to left, rgba(90, 179, 69, 0.1), rgb(90, 179, 69)) repeat scroll 0% 0%;
  215 +}
  216 +
  217 +.frame.highlight .theme.foreground {
  218 + background: linear-gradient(to top, rgba(173, 217, 163, 0.1), rgb(173, 217, 163)) repeat scroll 0% 0%;
  219 +}
  220 +
  221 +.frame.active .theme.foreground {
  222 + background: linear-gradient(to top, rgba(90, 179, 69, 0.1), rgb(90, 179, 69)) repeat scroll 0% 0%;
  223 +}
  224 +
  225 +.frame.highlight .theme.background {
  226 + background: linear-gradient(to bottom, rgba(173, 217, 163, 0.1), rgb(173, 217, 163)) repeat scroll 0% 0%;
  227 +}
  228 +
  229 +.frame.active .theme.background {
  230 + background: linear-gradient(to bottom, rgba(90, 179, 69, 0.1), rgb(90, 179, 69)) repeat scroll 0% 0%;
  231 +}
  232 +
  233 +.frame.highlight .theme.goal {
  234 + background: linear-gradient(to right, rgba(173, 217, 163, 0.1), rgb(173, 217, 163)) repeat scroll 0% 0%;
  235 +}
  236 +
  237 +.frame.active .theme.goal {
  238 + background: linear-gradient(to right, rgba(90, 179, 69, 0.1), rgb(90, 179, 69)) repeat scroll 0% 0%;
  239 +}
  240 +
  241 +.frame.highlight .recipient {
  242 + background-color: rgb(229, 167, 199);
  243 +}
  244 +
  245 +.frame.active .recipient {
  246 + background-color: rgb(203, 77, 141);
  247 +}
  248 +
  249 +.frame.highlight .recipient.source {
  250 + background: linear-gradient(to left, rgba(229, 167, 199, 0.1), rgb(229, 167, 199)) repeat scroll 0% 0%;
  251 +}
  252 +
  253 +.frame.active .recipient.source {
  254 + background: linear-gradient(to left, rgba(203, 77, 141, 0.1), rgb(203, 77, 141)) repeat scroll 0% 0%;
  255 +}
  256 +
  257 +.frame.highlight .recipient.foreground {
  258 + background: linear-gradient(to top, rgba(229, 167, 199, 0.1), rgb(229, 167, 199)) repeat scroll 0% 0%;
  259 +}
  260 +
  261 +.frame.active .recipient.foreground {
  262 + background: linear-gradient(to top, rgba(203, 77, 141, 0.1), rgb(203, 77, 141)) repeat scroll 0% 0%;
  263 +}
  264 +
  265 +.frame.highlight .recipient.background {
  266 + background: linear-gradient(to bottom, rgba(229, 167, 199, 0.1), rgb(229, 167, 199)) repeat scroll 0% 0%;
  267 +}
  268 +
  269 +.frame.active .recipient.background {
  270 + background: linear-gradient(to bottom, rgba(203, 77, 141, 0.1), rgb(203, 77, 141)) repeat scroll 0% 0%;
  271 +}
  272 +
  273 +.frame.highlight .recipient.goal {
  274 + background: linear-gradient(to right, rgba(229, 167, 199, 0.1), rgb(229, 167, 199)) repeat scroll 0% 0%;
  275 +}
  276 +
  277 +.frame.active .recipient.goal {
  278 + background: linear-gradient(to right, rgba(203, 77, 141, 0.1), rgb(203, 77, 141)) repeat scroll 0% 0%;
  279 +}
  280 +
  281 +.frame.highlight .result {
  282 + background-color: rgb(243, 205, 207);
  283 +}
  284 +
  285 +.frame.active .result {
  286 + background-color: rgb(231, 155, 159);
  287 +}
  288 +
  289 +.frame.highlight .result.source {
  290 + background: linear-gradient(to left, rgba(243, 205, 207, 0.1), rgb(243, 205, 207)) repeat scroll 0% 0%;
  291 +}
  292 +
  293 +.frame.active .result.source {
  294 + background: linear-gradient(to left, rgba(231, 155, 159, 0.1), rgb(231, 155, 159)) repeat scroll 0% 0%;
  295 +}
  296 +
  297 +.frame.highlight .result.foreground {
  298 + background: linear-gradient(to top, rgba(243, 205, 207, 0.1), rgb(243, 205, 207)) repeat scroll 0% 0%;
  299 +}
  300 +
  301 +.frame.active .result.foreground {
  302 + background: linear-gradient(to top, rgba(231, 155, 159, 0.1), rgb(231, 155, 159)) repeat scroll 0% 0%;
  303 +}
  304 +
  305 +.frame.highlight .result.background {
  306 + background: linear-gradient(to bottom, rgba(243, 205, 207, 0.1), rgb(243, 205, 207)) repeat scroll 0% 0%;
  307 +}
  308 +
  309 +.frame.active .result.background {
  310 + background: linear-gradient(to bottom, rgba(231, 155, 159, 0.1), rgb(231, 155, 159)) repeat scroll 0% 0%;
  311 +}
  312 +
  313 +.frame.highlight .result.goal {
  314 + background: linear-gradient(to right, rgba(243, 205, 207, 0.1), rgb(243, 205, 207)) repeat scroll 0% 0%;
  315 +}
  316 +
  317 +.frame.active .result.goal {
  318 + background: linear-gradient(to right, rgba(231, 155, 159, 0.1), rgb(231, 155, 159)) repeat scroll 0% 0%;
  319 +}
  320 +
  321 +.frame.highlight .instrument {
  322 + background-color: rgb(227, 239, 158);
  323 +}
  324 +
  325 +.frame.active .instrument {
  326 + background-color: rgb(199, 221, 60);
  327 +}
  328 +
  329 +.frame.highlight .instrument.source {
  330 + background: linear-gradient(to left, rgba(227, 239, 158, 0.1), rgb(227, 239, 158)) repeat scroll 0% 0%;
  331 +}
  332 +
  333 +.frame.active .instrument.source {
  334 + background: linear-gradient(to left, rgba(199, 221, 60, 0.1), rgb(199, 221, 60)) repeat scroll 0% 0%;
  335 +}
  336 +
  337 +.frame.highlight .instrument.foreground {
  338 + background: linear-gradient(to top, rgba(227, 239, 158, 0.1), rgb(227, 239, 158)) repeat scroll 0% 0%;
  339 +}
  340 +
  341 +.frame.active .instrument.foreground {
  342 + background: linear-gradient(to top, rgba(199, 221, 60, 0.1), rgb(199, 221, 60)) repeat scroll 0% 0%;
  343 +}
  344 +
  345 +.frame.highlight .instrument.background {
  346 + background: linear-gradient(to bottom, rgba(227, 239, 158, 0.1), rgb(227, 239, 158)) repeat scroll 0% 0%;
  347 +}
  348 +
  349 +.frame.active .instrument.background {
  350 + background: linear-gradient(to bottom, rgba(199, 221, 60, 0.1), rgb(199, 221, 60)) repeat scroll 0% 0%;
  351 +}
  352 +
  353 +.frame.highlight .instrument.goal {
  354 + background: linear-gradient(to right, rgba(227, 239, 158, 0.1), rgb(227, 239, 158)) repeat scroll 0% 0%;
  355 +}
  356 +
  357 +.frame.active .instrument.goal {
  358 + background: linear-gradient(to right, rgba(199, 221, 60, 0.1), rgb(199, 221, 60)) repeat scroll 0% 0%;
  359 +}
  360 +
  361 +.frame.highlight .manner {
  362 + background-color: rgb(223, 152, 150);
  363 +}
  364 +
  365 +.frame.active .manner {
  366 + background-color: rgb(191, 48, 44);
  367 +}
  368 +
  369 +.frame.highlight .manner.source {
  370 + background: linear-gradient(to left, rgba(223, 152, 150, 0.1), rgb(223, 152, 150)) repeat scroll 0% 0%;
  371 +}
  372 +
  373 +.frame.active .manner.source {
  374 + background: linear-gradient(to left, rgba(191, 48, 44, 0.1), rgb(191, 48, 44)) repeat scroll 0% 0%;
  375 +}
  376 +
  377 +.frame.highlight .manner.foreground {
  378 + background: linear-gradient(to top, rgba(223, 152, 150, 0.1), rgb(223, 152, 150)) repeat scroll 0% 0%;
  379 +}
  380 +
  381 +.frame.active .manner.foreground {
  382 + background: linear-gradient(to top, rgba(191, 48, 44, 0.1), rgb(191, 48, 44)) repeat scroll 0% 0%;
  383 +}
  384 +
  385 +.frame.highlight .manner.background {
  386 + background: linear-gradient(to bottom, rgba(223, 152, 150, 0.1), rgb(223, 152, 150)) repeat scroll 0% 0%;
  387 +}
  388 +
  389 +.frame.active .manner.background {
  390 + background: linear-gradient(to bottom, rgba(191, 48, 44, 0.1), rgb(191, 48, 44)) repeat scroll 0% 0%;
  391 +}
  392 +
  393 +.frame.highlight .manner.goal {
  394 + background: linear-gradient(to right, rgba(223, 152, 150, 0.1), rgb(223, 152, 150)) repeat scroll 0% 0%;
  395 +}
  396 +
  397 +.frame.active .manner.goal {
  398 + background: linear-gradient(to right, rgba(191, 48, 44, 0.1), rgb(191, 48, 44)) repeat scroll 0% 0%;
  399 +}
  400 +
  401 +.frame.highlight .purpose {
  402 + background-color: rgb(213, 171, 221);
  403 +}
  404 +
  405 +.frame.active .purpose {
  406 + background-color: rgb(171, 85, 186);
  407 +}
  408 +
  409 +.frame.highlight .purpose.source {
  410 + background: linear-gradient(to left, rgba(213, 171, 221, 0.1), rgb(213, 171, 221)) repeat scroll 0% 0%;
  411 +}
  412 +
  413 +.frame.active .purpose.source {
  414 + background: linear-gradient(to left, rgba(171, 85, 186, 0.1), rgb(171, 85, 186)) repeat scroll 0% 0%;
  415 +}
  416 +
  417 +.frame.highlight .purpose.foreground {
  418 + background: linear-gradient(to top, rgba(213, 171, 221, 0.1), rgb(213, 171, 221)) repeat scroll 0% 0%;
  419 +}
  420 +
  421 +.frame.active .purpose.foreground {
  422 + background: linear-gradient(to top, rgba(171, 85, 186, 0.1), rgb(171, 85, 186)) repeat scroll 0% 0%;
  423 +}
  424 +
  425 +.frame.highlight .purpose.background {
  426 + background: linear-gradient(to bottom, rgba(213, 171, 221, 0.1), rgb(213, 171, 221)) repeat scroll 0% 0%;
  427 +}
  428 +
  429 +.frame.active .purpose.background {
  430 + background: linear-gradient(to bottom, rgba(171, 85, 186, 0.1), rgb(171, 85, 186)) repeat scroll 0% 0%;
  431 +}
  432 +
  433 +.frame.highlight .purpose.goal {
  434 + background: linear-gradient(to right, rgba(213, 171, 221, 0.1), rgb(213, 171, 221)) repeat scroll 0% 0%;
  435 +}
  436 +
  437 +.frame.active .purpose.goal {
  438 + background: linear-gradient(to right, rgba(171, 85, 186, 0.1), rgb(171, 85, 186)) repeat scroll 0% 0%;
  439 +}
  440 +
  441 +.frame.highlight .attribute {
  442 + background-color: rgb(238, 155, 151);
  443 +}
  444 +
  445 +.frame.active .attribute {
  446 + background-color: rgb(220, 53, 47);
  447 +}
  448 +
  449 +.frame.highlight .attribute.source {
  450 + background: linear-gradient(to left, rgba(238, 155, 151, 0.1), rgb(238, 155, 151)) repeat scroll 0% 0%;
  451 +}
  452 +
  453 +.frame.active .attribute.source {
  454 + background: linear-gradient(to left, rgba(220, 53, 47, 0.1), rgb(220, 53, 47)) repeat scroll 0% 0%;
  455 +}
  456 +
  457 +.frame.highlight .attribute.foreground {
  458 + background: linear-gradient(to top, rgba(238, 155, 151, 0.1), rgb(238, 155, 151)) repeat scroll 0% 0%;
  459 +}
  460 +
  461 +.frame.active .attribute.foreground {
  462 + background: linear-gradient(to top, rgba(220, 53, 47, 0.1), rgb(220, 53, 47)) repeat scroll 0% 0%;
  463 +}
  464 +
  465 +.frame.highlight .attribute.background {
  466 + background: linear-gradient(to bottom, rgba(238, 155, 151, 0.1), rgb(238, 155, 151)) repeat scroll 0% 0%;
  467 +}
  468 +
  469 +.frame.active .attribute.background {
  470 + background: linear-gradient(to bottom, rgba(220, 53, 47, 0.1), rgb(220, 53, 47)) repeat scroll 0% 0%;
  471 +}
  472 +
  473 +.frame.highlight .attribute.goal {
  474 + background: linear-gradient(to right, rgba(238, 155, 151, 0.1), rgb(238, 155, 151)) repeat scroll 0% 0%;
  475 +}
  476 +
  477 +.frame.active .attribute.goal {
  478 + background: linear-gradient(to right, rgba(220, 53, 47, 0.1), rgb(220, 53, 47)) repeat scroll 0% 0%;
  479 +}
  480 +
  481 +.frame.highlight .location {
  482 + background-color: rgb(221, 193, 151);
  483 +}
  484 +
  485 +.frame.active .location {
  486 + background-color: rgb(187, 129, 45);
  487 +}
  488 +
  489 +.frame.highlight .location.source {
  490 + background: linear-gradient(to left, rgba(221, 193, 151, 0.1), rgb(221, 193, 151)) repeat scroll 0% 0%;
  491 +}
  492 +
  493 +.frame.active .location.source {
  494 + background: linear-gradient(to left, rgba(187, 129, 45, 0.1), rgb(187, 129, 45)) repeat scroll 0% 0%;
  495 +}
  496 +
  497 +.frame.highlight .location.foreground {
  498 + background: linear-gradient(to top, rgba(221, 193, 151, 0.1), rgb(221, 193, 151)) repeat scroll 0% 0%;
  499 +}
  500 +
  501 +.frame.active .location.foreground {
  502 + background: linear-gradient(to top, rgba(187, 129, 45, 0.1), rgb(187, 129, 45)) repeat scroll 0% 0%;
  503 +}
  504 +
  505 +.frame.highlight .location.background {
  506 + background: linear-gradient(to bottom, rgba(221, 193, 151, 0.1), rgb(221, 193, 151)) repeat scroll 0% 0%;
  507 +}
  508 +
  509 +.frame.active .location.background {
  510 + background: linear-gradient(to bottom, rgba(187, 129, 45, 0.1), rgb(187, 129, 45)) repeat scroll 0% 0%;
  511 +}
  512 +
  513 +.frame.highlight .location.goal {
  514 + background: linear-gradient(to right, rgba(221, 193, 151, 0.1), rgb(221, 193, 151)) repeat scroll 0% 0%;
  515 +}
  516 +
  517 +.frame.active .location.goal {
  518 + background: linear-gradient(to right, rgba(187, 129, 45, 0.1), rgb(187, 129, 45)) repeat scroll 0% 0%;
  519 +}
  520 +
  521 +.frame.highlight .path {
  522 + background-color: rgb(240, 189, 150);
  523 +}
  524 +
  525 +.frame.active .path {
  526 + background-color: rgb(224, 121, 44);
  527 +}
  528 +
  529 +.frame.highlight .path.source {
  530 + background: linear-gradient(to left, rgba(240, 189, 150, 0.1), rgb(240, 189, 150)) repeat scroll 0% 0%;
  531 +}
  532 +
  533 +.frame.active .path.source {
  534 + background: linear-gradient(to left, rgba(224, 121, 44, 0.1), rgb(224, 121, 44)) repeat scroll 0% 0%;
  535 +}
  536 +
  537 +.frame.highlight .path.foreground {
  538 + background: linear-gradient(to top, rgba(240, 189, 150, 0.1), rgb(240, 189, 150)) repeat scroll 0% 0%;
  539 +}
  540 +
  541 +.frame.active .path.foreground {
  542 + background: linear-gradient(to top, rgba(224, 121, 44, 0.1), rgb(224, 121, 44)) repeat scroll 0% 0%;
  543 +}
  544 +
  545 +.frame.highlight .path.background {
  546 + background: linear-gradient(to bottom, rgba(240, 189, 150, 0.1), rgb(240, 189, 150)) repeat scroll 0% 0%;
  547 +}
  548 +
  549 +.frame.active .path.background {
  550 + background: linear-gradient(to bottom, rgba(224, 121, 44, 0.1), rgb(224, 121, 44)) repeat scroll 0% 0%;
  551 +}
  552 +
  553 +.frame.highlight .path.goal {
  554 + background: linear-gradient(to right, rgba(240, 189, 150, 0.1), rgb(240, 189, 150)) repeat scroll 0% 0%;
  555 +}
  556 +
  557 +.frame.active .path.goal {
  558 + background: linear-gradient(to right, rgba(224, 121, 44, 0.1), rgb(224, 121, 44)) repeat scroll 0% 0%;
  559 +}
  560 +
  561 +.frame.highlight .time {
  562 + background-color: rgb(249, 246, 155);
  563 +}
  564 +
  565 +.frame.active .time {
  566 + background-color: rgb(242, 236, 54);
  567 +}
  568 +
  569 +.frame.highlight .time.source {
  570 + background: linear-gradient(to left, rgba(249, 246, 155, 0.1), rgb(249, 246, 155)) repeat scroll 0% 0%;
  571 +}
  572 +
  573 +.frame.active .time.source {
  574 + background: linear-gradient(to left, rgba(242, 236, 54, 0.1), rgb(242, 236, 54)) repeat scroll 0% 0%;
  575 +}
  576 +
  577 +.frame.highlight .time.foreground {
  578 + background: linear-gradient(to top, rgba(249, 246, 155, 0.1), rgb(249, 246, 155)) repeat scroll 0% 0%;
  579 +}
  580 +
  581 +.frame.active .time.foreground {
  582 + background: linear-gradient(to top, rgba(242, 236, 54, 0.1), rgb(242, 236, 54)) repeat scroll 0% 0%;
  583 +}
  584 +
  585 +.frame.highlight .time.background {
  586 + background: linear-gradient(to bottom, rgba(249, 246, 155, 0.1), rgb(249, 246, 155)) repeat scroll 0% 0%;
  587 +}
  588 +
  589 +.frame.active .time.background {
  590 + background: linear-gradient(to bottom, rgba(242, 236, 54, 0.1), rgb(242, 236, 54)) repeat scroll 0% 0%;
  591 +}
  592 +
  593 +.frame.highlight .time.goal {
  594 + background: linear-gradient(to right, rgba(249, 246, 155, 0.1), rgb(249, 246, 155)) repeat scroll 0% 0%;
  595 +}
  596 +
  597 +.frame.active .time.goal {
  598 + background: linear-gradient(to right, rgba(242, 236, 54, 0.1), rgb(242, 236, 54)) repeat scroll 0% 0%;
  599 +}
  600 +
  601 +.frame.highlight .duration {
  602 + background-color: rgb(245, 224, 131);
  603 +}
  604 +
  605 +.frame.active .duration {
  606 + background-color: rgb(233, 192, 6);
  607 +}
  608 +
  609 +.frame.highlight .duration.source {
  610 + background: linear-gradient(to left, rgba(245, 224, 131, 0.1), rgb(245, 224, 131)) repeat scroll 0% 0%;
  611 +}
  612 +
  613 +.frame.active .duration.source {
  614 + background: linear-gradient(to left, rgba(233, 192, 6, 0.1), rgb(233, 192, 6)) repeat scroll 0% 0%;
  615 +}
  616 +
  617 +.frame.highlight .duration.foreground {
  618 + background: linear-gradient(to top, rgba(245, 224, 131, 0.1), rgb(245, 224, 131)) repeat scroll 0% 0%;
  619 +}
  620 +
  621 +.frame.active .duration.foreground {
  622 + background: linear-gradient(to top, rgba(233, 192, 6, 0.1), rgb(233, 192, 6)) repeat scroll 0% 0%;
  623 +}
  624 +
  625 +.frame.highlight .duration.background {
  626 + background: linear-gradient(to bottom, rgba(245, 224, 131, 0.1), rgb(245, 224, 131)) repeat scroll 0% 0%;
  627 +}
  628 +
  629 +.frame.active .duration.background {
  630 + background: linear-gradient(to bottom, rgba(233, 192, 6, 0.1), rgb(233, 192, 6)) repeat scroll 0% 0%;
  631 +}
  632 +
  633 +.frame.highlight .duration.goal {
  634 + background: linear-gradient(to right, rgba(245, 224, 131, 0.1), rgb(245, 224, 131)) repeat scroll 0% 0%;
  635 +}
  636 +
  637 +.frame.active .duration.goal {
  638 + background: linear-gradient(to right, rgba(233, 192, 6, 0.1), rgb(233, 192, 6)) repeat scroll 0% 0%;
  639 +}
  640 +
  641 +.frame.highlight .measure {
  642 + background-color: rgb(247, 164, 205);
  643 +}
  644 +
  645 +.frame.active .measure {
  646 + background-color: rgb(238, 72, 154);
  647 +}
  648 +
  649 +.frame.highlight .measure.source {
  650 + background: linear-gradient(to left, rgba(247, 164, 205, 0.1), rgb(247, 164, 205)) repeat scroll 0% 0%;
  651 +}
  652 +
  653 +.frame.active .measure.source {
  654 + background: linear-gradient(to left, rgba(238, 72, 154, 0.1), rgb(238, 72, 154)) repeat scroll 0% 0%;
  655 +}
  656 +
  657 +.frame.highlight .measure.foreground {
  658 + background: linear-gradient(to top, rgba(247, 164, 205, 0.1), rgb(247, 164, 205)) repeat scroll 0% 0%;
  659 +}
  660 +
  661 +.frame.active .measure.foreground {
  662 + background: linear-gradient(to top, rgba(238, 72, 154, 0.1), rgb(238, 72, 154)) repeat scroll 0% 0%;
  663 +}
  664 +
  665 +.frame.highlight .measure.background {
  666 + background: linear-gradient(to bottom, rgba(247, 164, 205, 0.1), rgb(247, 164, 205)) repeat scroll 0% 0%;
  667 +}
  668 +
  669 +.frame.active .measure.background {
  670 + background: linear-gradient(to bottom, rgba(238, 72, 154, 0.1), rgb(238, 72, 154)) repeat scroll 0% 0%;
  671 +}
  672 +
  673 +.frame.highlight .measure.goal {
  674 + background: linear-gradient(to right, rgba(247, 164, 205, 0.1), rgb(247, 164, 205)) repeat scroll 0% 0%;
  675 +}
  676 +
  677 +.frame.active .measure.goal {
  678 + background: linear-gradient(to right, rgba(238, 72, 154, 0.1), rgb(238, 72, 154)) repeat scroll 0% 0%;
  679 +}
  680 +
  681 +.frame.highlight .lemma {
  682 + background-color: rgb(256, 256, 256);
  683 +}
  684 +
  685 +.frame.active .lemma {
  686 + background-color: rgb(256, 256, 256);
  687 +}
  688 +
  689 +.frame.highlight .lemma.source {
  690 + background: linear-gradient(to left, rgba(256, 256, 256, 0.1), rgb(256, 256, 256)) repeat scroll 0% 0%;
  691 +}
  692 +
  693 +.frame.active .lemma.source {
  694 + background: linear-gradient(to left, rgba(256, 256, 256, 0.1), rgb(256, 256, 256)) repeat scroll 0% 0%;
  695 +}
  696 +
  697 +.frame.highlight .lemma.foreground {
  698 + background: linear-gradient(to top, rgba(256, 256, 256, 0.1), rgb(256, 256, 256)) repeat scroll 0% 0%;
  699 +}
  700 +
  701 +.frame.active .lemma.foreground {
  702 + background: linear-gradient(to top, rgba(256, 256, 256, 0.1), rgb(256, 256, 256)) repeat scroll 0% 0%;
  703 +}
  704 +
  705 +.frame.highlight .lemma.background {
  706 + background: linear-gradient(to bottom, rgba(256, 256, 256, 0.1), rgb(256, 256, 256)) repeat scroll 0% 0%;
  707 +}
  708 +
  709 +.frame.active .lemma.background {
  710 + background: linear-gradient(to bottom, rgba(256, 256, 256, 0.1), rgb(256, 256, 256)) repeat scroll 0% 0%;
  711 +}
  712 +
  713 +.frame.highlight .lemma.goal {
  714 + background: linear-gradient(to right, rgba(256, 256, 256, 0.1), rgb(256, 256, 256)) repeat scroll 0% 0%;
  715 +}
  716 +
  717 +.frame.active .lemma.goal {
  718 + background: linear-gradient(to right, rgba(256, 256, 256, 0.1), rgb(256, 256, 256)) repeat scroll 0% 0%;
  719 +}
  720 +
... ...
common/templates/base.html
... ... @@ -12,7 +12,9 @@
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 16 {% block styles %}{% endblock %}
  17 + <link rel="stylesheet" type="text/css" href="{% static 'common/css/font.css' %}">
16 18 <link rel="stylesheet" type="text/css" href="{% static 'common/css/common.css' %}">
17 19 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
18 20 <!--might be needed for resizeable panels, causes errors if included after Popper-->
... ...
entries/forms.py
... ... @@ -271,8 +271,9 @@ class FormFactory(object):
271 271 if field_name is not None:
272 272 form_class.base_fields[FormFactory.unique_name(field_name, unique_number)] = field_maker()
273 273 return form_class(*args, **kwargs)
  274 +
274 275 @staticmethod
275   - def get_child_form_prefix():
  276 + def get_child_form_prefix(child_form):
276 277 raise NotImplementedError
277 278  
278 279 class SchemaFormFactory(FormFactory):
... ... @@ -543,7 +544,7 @@ class FrameFormFactory(FormFactory):
543 544 'num_preferences',
544 545 lambda: RangeFilter(
545 546 label=_('Liczba preferencyj selekcyjnych argumentu'),
546   - lookup='argument__preferences_count',
  547 + lookup='arguments__preferences_count',
547 548 ), None
548 549 ),
549 550 (
... ... @@ -551,6 +552,12 @@ class FrameFormFactory(FormFactory):
551 552 lambda n: and_or_form_creator(_('Argument'), 'add-argument-{}'.format(n), data_add='argument'),
552 553 ),
553 554 )
  555 +
  556 + @staticmethod
  557 + def get_child_form_prefix(child_form):
  558 + if child_form.model_class == Argument:
  559 + return 'arguments__in'
  560 + raise KeyError(type(child_form))
554 561  
555 562  
556 563 class ArgumentFormFactory(FormFactory):
... ... @@ -583,7 +590,7 @@ class ArgumentFormFactory(FormFactory):
583 590 'preference_type',
584 591 lambda: forms.ChoiceField(
585 592 label=_('Preferencja selekcyjna'),
586   - choices=(('predefined', _('Predefiniowana grupa znaczeń')), ('relational', _('Wyrażona przez relację')), ('synset', _('Wyrażona przez jednostkę leksykalną Słowosieci'))),
  593 + choices=(('', _('wybierz')), ('predefined', _('Predefiniowana grupa znaczeń')), ('relational', _('Wyrażona przez relację')), ('synset', _('Wyrażona przez jednostkę leksykalną Słowosieci'))),
587 594 required=False,
588 595 ),
589 596 lambda n: and_or_form_creator(_('Preferencja selekcyjna'), 'add-preference-{}'.format(n), field_name=FormFactory.unique_name('preference_type', n))
... ...
entries/static/entries/js/entries.js
... ... @@ -312,7 +312,7 @@ function schema2dom(schema) {
312 312 var div = document.createElement('div');
313 313 div.className = 'schema';
314 314 var table = document.createElement('table');
315   - table.className = 'table table-borderless border border-secondary';
  315 + table.className = 'table table-borderless border border-secondary text-dark';
316 316 var tbody = document.createElement('tbody');
317 317  
318 318 // opinion
... ... @@ -341,10 +341,10 @@ function schema2dom(schema) {
341 341 props_td.innerHTML = props_spans.join(',');
342 342 props_row.append(props_td);
343 343 // don’t append to phrases_row.innerHTML since it automatically closes tags *** (?)
344   - phrases_html += '<td class="px-1 border-top border-left border-secondary text-break">';
  344 + phrases_html += '<td class="px-1 py-0 border-top border-left border-secondary text-break">';
345 345 for (var j in position.phrases) {
346 346 var phrase = position.phrases[j];
347   - var cls = j > 0 ? ' border-top border-secondary' : '';
  347 + var cls = j > 0 ? ' border-top' : '';
348 348 for (var k in phrase.arguments) {
349 349 cls += ' argument-' + phrase.arguments[k];
350 350 }
... ... @@ -392,10 +392,10 @@ function show_syntax(subentries) {
392 392 $('#syntax').append($(schemata_dom));
393 393  
394 394 $('#syntax').find('.schema').mouseenter(function() {
395   - $(this).addClass('bg-red');
396   - show_debug('Kliknięcie na schemat spowoduje wyświetlenie przykładów.');
  395 + $(this).addClass('bg-highlight');
  396 + show_debug(gettext('Kliknij, aby wyświetlić przykłady dla tego schematu.'));
397 397 }).mouseleave(function() {
398   - $(this).removeClass('bg-red');
  398 + $(this).removeClass('bg-highlight');
399 399 clear_debug();
400 400 });
401 401 }
... ... @@ -404,7 +404,7 @@ function frame2dom(frame) {
404 404 var div = document.createElement('div');
405 405 div.className = 'frame';
406 406 var table = document.createElement('table');
407   - table.className = 'table table-borderless border border-secondary';
  407 + table.className = 'table table-borderless border border-secondary text-dark';
408 408 var tbody = document.createElement('tbody');
409 409  
410 410 // opinion
... ... @@ -422,12 +422,12 @@ function frame2dom(frame) {
422 422 cls += ' phrase-' + argument.phrases[j];
423 423 }
424 424 var data = ' data-argument_id="' + argument.id + '"';
425   - roles_row.innerHTML += '<td class="py-2 px-1 border-top border-left border-secondary' + cls + '"' + data + '>' + argument.str + '</td>';
  425 + roles_row.innerHTML += '<td class="py-2 px-1 border-top border-left border-secondary' + cls + ' ' + argument.cls + '"' + data + '>' + argument.str + '</td>';
426 426  
427 427 // don’t append to preferences_html.innerHTML since it automatically closes tags *** (?)
428   - preferences_html += '<td class="px-1 border-top border-left border-secondary text-break' + cls + '"' + data + '>'
  428 + preferences_html += '<td class="py-0 px-1 border-top border-left border-secondary text-break' + cls + '"' + data + '>'
429 429 for (var j in argument.preferences) {
430   - var cls = j > 0 ? ' border-top border-secondary' : '';
  430 + var cls = j > 0 ? ' border-top' : '';
431 431 preferences_html += '<div class="preference py-2' + cls + '">' + argument.preferences[j] + '</div>';
432 432 }
433 433 // *** and we want to close the <td> here
... ... @@ -461,6 +461,23 @@ function show_semantics(frames, subentries) {
461 461 $('#semantics-schemata').append($(schemata_dom));
462 462 var frames_dom = frames2dom(frames);
463 463 $('#semantics-frames').append($(frames_dom));
  464 +
  465 + $('.frame').mouseenter(function() {
  466 + var frame = $(this);
  467 + if (!frame.hasClass('active')) {
  468 + $(this).addClass('highlight bg-highlight');
  469 + show_debug(gettext('Kliknij, aby wyświetlić przykłady dla tej ramy oraz jej powiązanie ze schematami.'));
  470 + }
  471 + }).mouseleave(function() {
  472 + $(this).removeClass('highlight bg-highlight');
  473 + clear_debug();
  474 + }).click(function() {
  475 + var frame = $(this);
  476 + if (!frame.hasClass('active')) {
  477 + $('.frame.active').removeClass('active');
  478 + frame.addClass('active');
  479 + }
  480 + });
464 481 }
465 482  
466 483 function get_schemata_and_frames(entry_id) {
... ...
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 'common/css/role_colours.css' %}">
13 14 {% endblock %}
14 15  
15 16 {% block scripts %}
... ...
entries/views.py
... ... @@ -205,6 +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__argument_connections__argument__role__attribute__isnull=False)
208 210 t3 = datetime.datetime.now()
209 211 entries_list = list(entries.values_list('id', 'name', 'status__key'))[:DEBUG_N]
210 212 t4 = datetime.datetime.now()
... ... @@ -287,9 +289,10 @@ def frame2dict(frame, arg2phr):
287 289 {
288 290 'str' : str(a),
289 291 'id' : '-'.join(map(str, (frame.id, a.id))),
  292 + 'cls' : '{}{}'.format(a.role.role.role.lower(), ' ' + a.role.attribute.attribute.lower() if a.role.attribute else ''),
290 293 'preferences' : list(map(str, get_prefs_list(a))),
291 294 'phrases' : list(arg2phr['-'.join(map(str, (frame.id, a.id)))]),
292   - } for a in frame.argument_set.all()
  295 + } for a in sorted(frame.arguments.all(), key=lambda a: a.role.role.priority + (a.role.attribute.priority if a.role.attribute else 2))
293 296 ],
294 297 }
295 298  
... ... @@ -340,7 +343,7 @@ def get_entry(request):
340 343 schemata.append(schema2dict(schema, phr2arg, subentry.negativity))
341 344 if schemata:
342 345 subentries.append({ 'str' : subentry2str(subentry), 'schemata' : schemata })
343   - frame_objects = Frame.objects.filter(argument__argument_connections__schema_connections__subentry__entry=entry).distinct()
  346 + frame_objects = Frame.objects.filter(arguments__argument_connections__schema_connections__subentry__entry=entry).distinct()
344 347 if filter_frames:
345 348 frame_objects = get_filtered_objects2(frame_objects, frame_forms)
346 349 frames = [frame2dict(frame, arg2phr) for frame in frame_objects]
... ...
importer/Entry.py
... ... @@ -32,6 +32,7 @@ class Entry:
32 32 self._syntax.store(entry, stored_positions)
33 33 if self._semantics is not None:
34 34 self._semantics.store(entry, all_meanings)
  35 + entry.save()
35 36 self._examples.store(entry, all_meanings)
36 37  
37 38 def __str__(self):
... ...
meanings/management/commands/import_plWordnet.py
... ... @@ -98,7 +98,8 @@ def import_plWordnet():
98 98 store = synsets[i*BULK:min((i+1)*BULK, max_len)]
99 99 Synset.objects.bulk_create(store)
100 100 i += 1
101   - print(str(i*BULK) + "...")
  101 + if (i % 50 == 0):
  102 + print(str(i*BULK) + "...")
102 103 print("...DONE")
103 104  
104 105 print("")
... ... @@ -111,5 +112,6 @@ def import_plWordnet():
111 112 store = lexical_units[i*BULK:min((i+1)*BULK, max_len)]
112 113 LexicalUnit.objects.bulk_create(store)
113 114 i += 1
114   - print(str(i*BULK) + "...")
  115 + if (i % 20 == 0):
  116 + print(str(i*BULK) + "...")
115 117 print("...DONE")
... ...
semantics/admin.py
1 1 from django.contrib import admin
2 2  
3 3 from .models import Argument, Frame, FrameOpinion, PredefinedSelectionalPreference, RelationalSelectionalPreference, \
4   - SelectionalPreferenceRelation, SemanticRole
  4 + SelectionalPreferenceRelation, ArgumentRole, SemanticRole, RoleAttribute
5 5  
6 6 admin.site.register(Argument)
7 7 admin.site.register(Frame)
... ... @@ -9,4 +9,6 @@ admin.site.register(FrameOpinion)
9 9 admin.site.register(PredefinedSelectionalPreference)
10 10 admin.site.register(RelationalSelectionalPreference)
11 11 admin.site.register(SelectionalPreferenceRelation)
  12 +admin.site.register(ArgumentRole)
12 13 admin.site.register(SemanticRole)
  14 +admin.site.register(RoleAttribute)
... ...
semantics/models.py
... ... @@ -32,7 +32,7 @@ class Argument(models.Model):
32 32 predefined = models.ManyToManyField('PredefinedSelectionalPreference')
33 33 synsets = models.ManyToManyField(Synset)
34 34 relations = models.ManyToManyField('RelationalSelectionalPreference')
35   - frame = models.ForeignKey(Frame, on_delete=models.PROTECT)
  35 + frame = models.ForeignKey(Frame, related_name='arguments', on_delete=models.PROTECT)
36 36 preferences_count = models.PositiveIntegerField(null=False, default=0)
37 37  
38 38 def __str__(self):
... ... @@ -47,7 +47,7 @@ class ArgumentRole(models.Model):
47 47 if self.attribute is None:
48 48 return str(self.role)
49 49 else:
50   - return str(self.role) + " " + str(self.attribute)
  50 + return '{}, {}'.format(str(self.role), str(self.attribute))
51 51  
52 52  
53 53 class SemanticRole(models.Model):
... ...
syntax/management/commands/import_tei.py
... ... @@ -35,7 +35,7 @@ def import_tei():
35 35 xml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), xml_file)
36 36  
37 37 import_constants()
38   -
  38 +
39 39 parser = make_parser()
40 40 parser.setFeature(handler.feature_external_ges, False)
41 41  
... ... @@ -43,9 +43,9 @@ def import_tei():
43 43 parser.parse(xml_path)
44 44  
45 45 entry_meanings = parser.getContentHandler().entry_meanings
46   - meanings = parser.getContentHandler().meanings
  46 + meanings = parser.getContentHandler().meanings
47 47 frames = parser.getContentHandler().frames
48   -
  48 +
49 49 parser.setContentHandler(WalentyTeiHandler(entry_meanings, meanings, frames))
50 50 parser.parse(xml_path)
51 51  
... ... @@ -93,7 +93,7 @@ def import_frame_opinions():
93 93 for pri, short in opinions:
94 94 opinion = FrameOpinion(key=short, priority=pri)
95 95 opinion.save()
96   -
  96 +
97 97 def import_aspects():
98 98 aspects = [(10, u'imperf'), (20, u'perf'), (32, u'_'), (42, u'')]
99 99 for pri, name in aspects:
... ... @@ -132,11 +132,33 @@ def import_control_tags():
132 132 controls = [(10, u'pred_controller'), (20, 'pred_controllee')]
133 133 for pri, name in controls:
134 134 cont = PredicativeControl(name=name, priority=pri)
135   - cont.save()
  135 + cont.save()
136 136  
137 137 def import_semantic_roles():
138   - roles = [(10, u'Initiator', u'91,106,217', None), (20, u'Stimulus', u'62,173,226', None), (30, u'Theme', u'90,179,69', None), (40, u'Experiencer', u'149,195,86', None), (50, u'Factor', u'82,150,87', None), (60, u'Instrument', u'199,221,60', None), (70, u'Recipient', u'203,77,141', None), (80, u'Result', u'231,155,159', None), (90, u'Attribute', u'220,53,47', None), (100, u'Manner', u'191,48,44', None), (110, u'Measure', u'238,72,154', None), (120, u'Location', u'187,129,45', None), (130, u'Path', u'224,121,44', None), (140, u'Time', u'242,236,54', None), (150, u'Duration', u'233,192,6', None), (160, u'Purpose', u'171,85,186', None), (170, u'Condition', u'127,199,195', None), (180, u'Lemma', u'256,256,256', None)]
139   - attributes = [(10, u'Source', None, u'left'), (30, u'Foreground', None, u'top'), (40, u'Background', None, u'bottom'), (20, u'Goal', None, u'right')]
  138 + roles = [
  139 + (10, u'Initiator', u'91,106,217', None),
  140 + (20, u'Stimulus', u'62,173,226', None),
  141 + (30, u'Condition', u'127,199,195', None),
  142 + (40, u'Factor', u'82,150,87', None),
  143 + (50, u'Experiencer', u'149,195,86', None),
  144 + (60, u'Theme', u'90,179,69', None),
  145 + (70, u'Recipient', u'203,77,141', None),
  146 + (80, u'Result', u'231,155,159', None),
  147 + (90, u'Instrument', u'199,221,60', None),
  148 + (100, u'Manner', u'191,48,44', None),
  149 + (110, u'Purpose', u'171,85,186', None),
  150 + (120, u'Attribute', u'220,53,47', None),
  151 + (130, u'Location', u'187,129,45', None),
  152 + (140, u'Path', u'224,121,44', None),
  153 + (150, u'Time', u'242,236,54', None),
  154 + (160, u'Duration', u'233,192,6', None),
  155 + (170, u'Measure', u'238,72,154', None),
  156 + (180, u'Lemma', u'256,256,256', None)
  157 + ]
  158 + # priorities set so that, when role and attribute priorities are added,
  159 + # Role_Source < Role_Foreground < Role_Background < Role_Goal
  160 + # and Role can be inserted anywhere into that hierarchy
  161 + attributes = [(1, u'Source', None, u'left'), (3, u'Foreground', None, u'top'), (5, u'Background', None, u'bottom'), (7, u'Goal', None, u'right')]
140 162 for pri, role, color, gradient in roles:
141 163 role = SemanticRole(role=role, color=color, priority=pri)
142 164 role.save()
... ... @@ -146,11 +168,11 @@ def import_semantic_roles():
146 168  
147 169 for role in SemanticRole.objects.all():
148 170 r = ArgumentRole(role=role, attribute=None)
149   - r.save()
  171 + r.save()
150 172 for attribute in RoleAttribute.objects.all():
151 173 r = ArgumentRole(role=role, attribute=attribute)
152 174 r.save()
153   -
  175 +
154 176 def import_predefined_preferences():
155 177 predefs = [u'ALL', u'LUDZIE', u'ISTOTY', u'PODMIOTY', u'KOMUNIKAT', u'KONCEPCJA', u'WYTWÓR', u'JADŁO', u'CZAS', u'OBIEKTY', u'CECHA', u'CZYNNOŚĆ', u'KIEDY', u'CZEMU', u'ILOŚĆ', u'POŁOŻENIE', u'DOBRA', u'MIEJSCE', u'SYTUACJA', u'OTOCZENIE']
156 178 for name in predefs:
... ...