<!DOCTYPE html>
<html>
  <head>
    <title>DeReKo-Word-Vector-Distances: <%= $word %></title>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
    <link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Condensed" rel="stylesheet">
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script src = "https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
    <script src = "https://cdn.datatables.net/fixedcolumns/3.2.3/js/dataTables.fixedColumns.min.js"></script>
    <script src = "https://cdn.datatables.net/plug-ins/1.10.16/sorting/scientific.js"></script>
    <link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
    <script
      src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
           integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
           crossorigin="anonymous"></script>
    <script>
     var urlParams = new URLSearchParams(window.location.search);

     $('#firstable').hide();
     $(document).ready(function() {

         $("input").bind("keydown", function(event) {
             // track enter key
             var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode));
             if (keycode == 13) { // keycode for enter key
                 // force the 'Enter Key' to implicitly click the Update button
                 document.getElementById('SEARCH').click();
                 return false;
             } else  {
                 return true;
             }});

         $( "#tabs" ).on( "tabsactivate", function( event, ui ) {
             if (localStorage) localStorage['tab'] = ui.newTab.index();
         });

         $(function(){
             $("#SEARCH").click(function() {
                 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
             });
         });

         function changeCharColor(txt, heat) {
             var newText = "";
             for (var i=0, l=txt.length; i<l; i++) {
                 newText += (i == 5 ? txt.charAt(i) : '<span style="background-color:'+getHeatColor(heat[i]/maxHeat)+'">'+txt.charAt(i)+'</span>');
             }
             return newText;
         }

         function getHeatColor(value) {
             var hue=((1-value)*120).toString(10);
             return ["hsl(",hue,",90%,70%)"].join("");
         }

         function bitvec2window(n, heat) {
             var str = n.toString(2).padStart(10, "0")
                        .replace(/^([0-9]{5})/, '$1x')
                        .replace(/0/g, '·')
                        .replace(/1/g, '+');
             return changeCharColor(str, heat);
         }

         % use Mojo::ByteStream 'b';
         var paraResults = <%= b(Mojo::JSON::to_json($lists)) %>;
         var urlprefix =  new URLSearchParams(window.location.search);
         if (paraResults.length > 0  && paraResults[0] != null) {
             var nvecs = [],
                 nwords = [],
                 nranks = [],
                 nmarked = [];
             for(var i = 0; i < paraResults.length; i++) {
                 nwords = nwords.concat(paraResults[i].map(function(a){return a.word;}));
                 nvecs = nvecs.concat(paraResults[i].map(function(a){return a.vector;}));
                 nranks = nranks.concat(paraResults[i].map(function(a){return a.rank;}));
                 nmarked = nmarked.concat(paraResults[i].map(function(a){return a.marked;}));
             }
             showMap({target: " "+urlParams.get('word')+" ", mergedEnd: 0, words: nwords, vecs: nvecs, ranks: nranks, marked: nmarked} );
             var t = $('#firsttable').DataTable({
                 data: paraResults[0],
                 "sScrollY": "780px",
                 "bScrollCollapse": true,
                 "bPaginate": false,
                 "bJQueryUI": true,
                 "dom": '<"top">rt<"bottom"flp><"clear">',
                 "columns": [
                     { "data": "rank", type: "allnumeric" },
                     { "data": "dist",  render: function ( data, type, row ) {return data.toFixed(3) }},
                     { "data": "word",  render: function ( data, type, row ) {urlprefix.set("word", data); return  '<a href="?' + urlprefix + '">' + data + '</a>' }}
                 ],
                 "columnDefs": [
                     { className: "dt-right", "targets": [0,1] },
                     { "searchable": false,
                       "orderable": false,
                       "targets": 0
                     },
                     { "orderSequence": [ "desc" ], "targets": [ 1 ] },
                     { "orderSequence": [ "asc", "desc" ], "targets": [ 2 ] },
                 ],
                 "oLanguage": {
                     "sSearch": "Filter: "
                 },
                 "order": [[ 1, 'desc' ]],
             } );

             t.on( 'order.dt search.dt', function () {
                 t.column(0, {order:'applied'}).nodes().each( function (cell, i) {
                     cell.innerHTML = i+1;
                 } );
             } ).draw();

             $( "#first" ).clone().prependTo( "#tabs-2" );

         }

         var collocatorData = <%= b(Mojo::JSON::to_json($collocators)) %>;
         var maxHeat; // = Math.max.apply(Math,collocatorData.map(function(o){return o.cprob;}))

         if (collocatorData != null) {
             maxHeat = Math.max.apply(Math,collocatorData.map(function(o){return Math.max.apply(Math,o.heat);}))
             var t = $('#secondtable').DataTable({
                 data: collocatorData,
                 "sScrollY": "780px",
                 "bScrollCollapse": true,
                 "bPaginate": false,
                 "bJQueryUI": true,
                 "dom": '<"top">rt<"bottom"flp><"clear">',
                 "columns": [
                     { "data": "rank", type: "allnumeric" },
                     { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat) }},
                     { "data": "max",  render: function ( data, type, row ) {return data.toFixed(3) }},
                     { "data": "conorm", render: function ( data, type, row ) {return data.toFixed(3) }},
                     { "data": "prob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) }  },
                     { "data": "cprob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) }  },
                     { "data": "overall", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
                     { "data": "word",  sClass: "collocator" }
                 ],
                 "columnDefs": [
                     { className: "dt-right", "targets": [0,2,3,4,5,6] },
                     { className: "dt-center", "targets": [ 1] },
                     { "searchable": false,
                       "orderable": false,
                       "targets": 0
                     },
                     { "type": "scientific", targets: [2,3,4,5,6] },
                     { "orderSequence": [ "desc" ], "targets": [ 2, 3, 4, 5, 6 ] },
                     { "orderSequence": [ "asc", "desc" ], "targets": [ 1, 7 ] },
                 ],
                 "oLanguage": {
                     "sSearch": "Filter: "
                 },
                 "order": [[ 4, 'desc' ]],
             } );

             t.on( 'order.dt search.dt', function () {
                 t.column(0, {order:'applied'}).nodes().each( function (cell, i) {
                     cell.innerHTML = i+1;
                 } );
             } ).draw();

             if (localStorage && !window.location.hash) { // let's not crash if some user has IE7
                 var index = parseInt(localStorage['tab']||'0');
                 $("#tabs").tabs({ active: index });
             }
         }
         $("#tabs").css("visibility", "visible"); // now we can show the tabs

     });

     $(function(){
         $("#dropdownoptions").dialog({
             title: "Options",
             autoOpen: false,
             modal: false,
             draggable: false,
             height: "auto",
             width: "auto",
             resizable: false,
             buttons: {
                 "Cancel": function() {
                     $( this ).dialog( "close" );
                 },
                 "Apply": function() {
                     window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
                 }
             }
         });
     });

     $(function(){
         $("td.collocator").click(function(){
             queryKorAPCII(this.textContent + " /w5 " + urlParams.get('word'));
         });
     });

     $(function(){
         $("#showoptions").click(function(){
             $("#dropdownoptions").dialog("open");
             var target = $(this);
             $("#dropdownoptions").dialog("widget").position({
                 my: 'left bottom',
                 at: 'left bottom',
                 of: target
             });
         });
     });

     $( function() {
         $( "#no_iterations" ).spinner({
             spin: function( event, ui ) {
                 if ( ui.value < 1000 ) {
                     $( this ).spinner( "value", 1000 );
                     return false;
                 } else if ( ui.value > 10000 ) {
                     $( this ).spinner( "value", 10000 );
                     return false;
                 }
             }
         });
     } );

     $( function() {
         $( "#neighbours" ).spinner({
             spin: function( event, ui ) {
                 if ( ui.value < 0 ) {
                     $( this ).spinner( "value", 0 );
                     return false;
                 } else if ( ui.value > 200 ) {
                     $( this ).spinner( "value", 200 );
                     return false;
                 }
             }
         });
     } );

     $( function() {
         $( "#cutoff" ).spinner({
             spin: function( event, ui ) {
                 if ( ui.value < 100000 ) {
                     $( this ).spinner( "value", 100000 );
                     return false;
                 } else if ( ui.value > 2000000 ) {
                     $( this ).spinner( "value", 2000000 );
                     return false;
                 }
             }
         });
     } );

     $( function() {
         $( "#tabs" ).tabs().addClass('tabs-min');
     } );

     $( function() {
         $( ".controlgroup-vertical" ).controlgroup({
             "direction": "vertical"
         });
     } );

     $(function() {
         $( document ).tooltip({
             content: function() {
                 return $(this).attr('title');
             }}
         )
     })

    </script>
    <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
    <script src="/derekovecs/js/tsne.js"></script>
    <script src="/derekovecs/js/som.js"></script>
    <script src="/derekovecs/js/labeler.js"></script>
    <style>
     body, input {
       font-family: Lato, sans-serif;
       font-size: 11pt;
     }

     h1,  h2, h3 {
       margin: 5px 10px 0 0;
       color: rgb(246,168,0);
       font-family: "Univers LT Std 47 Cn Lt", "Univers LT Std 67 Cn Lt", "Roboto Condensed", "Univers LT Std 67 Cn Bold", "UniversLTStd-BoldCn", "Times", 'League Gothic', Impact, sans-serif;
       font-weight: bold;
       line-height: 1.35;
       letter-spacing: normal;
       text-transform: uppercase;
       text-shadow: none;
       word-wrap: break-word;
     }


     showoptions, #SEARCH {
       margin-left: 10px;
       margin-right: 10px;
     }

     .tabs-left-vertical .ui-tabs-nav {
       position: absolute;
       width: 21em;
       transform: translate(-100%,0%) rotate(-90deg);
       transform-origin: 100% 0%;
     }

     .tabs-left-vertical .ui-tabs-nav li {
       float: right;
     }

     .tabs-left-vertical .ui-tabs-panel {
       padding-left: 3.5em;
     }

     .tabs-left-vertical .ui-tabs-panel {
       height: 20em;
     }

     .mono {
       font-family: "DejaVu Sans Mono", Inconsolata, SourceCodePro, Courier;
     }

     .ui-tooltip-content {
       font-size: 9pt;
       color: #222222;
     }

     svg > .ui-tooltip-content {
       font-size: 8pt;
       color: #222222;
     }

     a.merged {
       color: green;
       fill: green;
     }

     #first a {
       text-decoration: none;
     }

     a.marked, #first a.marked {
       text-decoration: underline;
     }

     a.target {
       color: red;
       fill: red;
     }

     table.display {
       width: 40% important!;
       margin: 1;  /* <- works for me this way ****/
     }

     table.dataTable thead th, table.dataTable thead td, table.dataTable tbody td {
       padding: 2px 2px;
       //  border-bottom: 1px solid #111;
     }

     td.collocator {
       cursor: pointer;
     }

     #collocators {
       margin-bottom: 15px;
     }

     #header {
       width: 100%;
       //   border: 1px solid red;
       overflow: hidden; /* will contain if #first is longer than #second */
     }

     #topwrapper {
       width: 100%;
       //   border: 1px solid red;
       overflow: hidden; /* will contain if #first is longer than #second */
     }

     #wrapper {
       //   border: 1px solid red;
       overflow: hidden; /* will contain if #first is longer than #second */
     }

     #pagetitle {
       max-width: 460px;
       margin-right: 20px;
       float: left;
       overflow: hidden; /* if you don't want #second to wrap below #first */
       //    border: 1px solid green;
     }

     #options {
       float: left;
       width: 800px;
       margin: 10px;
       overflow: hidden; /* if you don't want #second to wrap below #first */
     }

     #word {
       width: 50%;
     }

     #first {
       margin-right: 20px;
       float: left;
       overflow: hidden; /* if you don't want #second to wrap below #first */
       //    border: 1px solid green;
     }
     #tabs {
       margin-right: 20px;
       overflow: hidden; /* if you don't want #second to wrap below #first */
     }

     .tabs-min {
       background: transparent;
       border: none;
     }

     .tabs-min .ui-widget-header {
       background: transparent;
       border: none;
       border-bottom: 1px solid #c0c0c0;
       -moz-border-radius: 0px;
       -webkit-border-radius: 0px;
       border-radius: 0px;
     }

     .tabs-min .ui-tabs-nav .ui-state-default {
       background: transparent;
       border: none;
     }

     .tabs-min .ui-tabs-nav .ui-state-active {
       background: transparent url(derekovecs/img/uiTabsArrow.png) no-repeat bottom center;
       border: none;
     }

     .tabs-min .ui-tabs-nav .ui-state-default a {
       color: #c0c0c0;
     }

     .tabs-min .ui-tabs-nav .ui-state-active a {
       color: rgb(246,168,0);
     }

     #embed {
       max-width: 802px;
       border: 1px solid #333;
     }

     #second {
       min-width: 800px;
       //       border: 1px solid #333;
       overflow: hidden; /* if you don't want #second to wrap below #first */
     }
     #som2 svg {
       border: 1px solid #333;
     }

     #cost {
       font-size: 8pt;
       color: #222222;
       margin-top: 4px;
       margin-bottom: 12px;
     }

     #sominfo1, #sominfo {
       font-size: 8pt;
       color: #222222;
       margin-top: 0px;
     }

     #somcolor1, #somcolor2, #somcolor3 {
       display: inline-block;
       height: 10px;
       width: 10px;
     }

     #third {
       border: 1px solid #333;
     }

    </style>
    <script>

     var opt = {epsilon: <%= $epsilon %>, perplexity: <%= $perplexity %>},
         mapWidth = 800, // width map
         mapHeight = 800,
         jitterRadius = 7;

     var T = new tsnejs.tSNE(opt); // create a tSNE instance

     var Y;

     var data;
     var labeler;

     function applyJitter() {
         svg.selectAll('.tsnet')
            .data(labels)
            .transition()
            .duration(50)
            .attr("transform", function(d, i) {
                T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20;
                T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20;
                return "translate(" +
                                (d.x) + "," +
                                (d.y) + ")";
            });
     }

     function updateEmbedding() {
         var Y = T.getSolution();
         svg.selectAll('.tsnet')
            .data(data.words)
            .attr("transform", function(d, i) {
                return "translate(" +
                                 ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
                                 ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
     }

     var svg;
     var labels = [];
     var anchor_array = [];
     var text;

     function drawEmbedding() {
         var urlprefix =  new URLSearchParams(window.location.search);
         urlprefix.delete("word");
         urlprefix.append("word","");

         $("#embed").empty();
         var div = d3.select("#embed");

         // get min and max in each column of Y
         var Y = T.Y;

         svg = div.append("svg") // svg is global
                  .attr("width", mapWidth)
                  .attr("height", mapHeight);

         var g = svg.selectAll(".b")
                    .data(data.words)
                    .enter().append("g")
                    .attr("class", "tsnet");

         g.append("a")
          .attr("xlink:href", function(word) {
              return "?"+urlprefix+word; })
          .attr("class", function(d, i) {
              var res="";
              if(data.marked[i]) {
                  res="marked ";
              }
              if(data.target.indexOf(" "+d+" ") >= 0) {
                  return res+"target";
              } else if(data.ranks[i] < data.mergedEnd) {
                  return res+"merged";
              } else {
                  return res;
              }
          })
          .attr("title", function(d, i) {
              if(data.mergedEnd > 0) {
                  if(data.ranks[i] >= data.mergedEnd) {
                      return "rank: "+i +"  "+"freq. rank: "+(data.ranks[i]).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
                  } else {
                      return "rank: "+i +"  "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " (merged vocab)";
                  }
              } else {
                  return "rank: "+i +"  "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
              }
          })
          .append("text")
          .attr("text-anchor", "top")
          .attr("font-size", 12)
          .text(function(d) { return d; });

         var zoomListener = d3.behavior.zoom()
                              .scaleExtent([0.1, 10])
                              .center([0,0])
                              .on("zoom", zoomHandler);
         zoomListener(svg);
     }

     var tx=0, ty=0;
     var ss=1;
     var iter_id=-1;

     function zoomHandler() {
         tx = d3.event.translate[0];
         ty = d3.event.translate[1];
         ss = d3.event.scale;
         updateEmbedding();
     }

     var stepnum = 0;

     function stopStep() {
         clearInterval(iter_id);
         text = svg.selectAll("text");

         // jitter function needs different data and co-ordinate representation
         labels = d3.range(data.words.length).map(function(i) {
             var x = (T.Y[i][0]*20*ss + tx) + mapWidth/2;
             var y = (T.Y[i][1]*20*ss + ty) + mapHeight/2;
             anchor_array.push({x: x, y: y, r: jitterRadius});
             return {
                 x: x,
                 y: y,
                 name: data.words[i]
             };
         });

         // get the actual label bounding boxes for the jitter function
         var index = 0;
         text.each(function() {
             labels[index].width = this.getBBox().width;
             labels[index].height = this.getBBox().height;
             index += 1;
         });


         //  setTimeout(updateEmbedding, 1);
         //  setTimeout(
         labeler =   d3.labeler()
                       .label(labels)
                       .anchor(anchor_array)
                       .width(mapWidth)
                       .height(mapHeight)
                       .update(applyJitter);
         //         .start(1000);

         iter_id = setInterval(jitterStep, 1);
     }

     var jitter_i=0;

     function jitterStep() {
         if(jitter_i++ > 100) {
             clearInterval(iter_id);
         } else {
             labeler.start2(10);
             applyJitter();
         }
     }

     var last_cost=1000;

     function step() {
         var i = T.iter;

         if(i > <%= $no_iterations %>) {
             stopStep();
         } else {
             var cost = Math.round(T.step() * 100000) / 100000; // do a few steps
             $("#cost").html("tsne iteration " + i + ", cost: " + cost.toFixed(5));
             if(i % 250 == 0 && cost >= last_cost) {
                 stopStep();
             } else {
                 last_cost = cost;
                 updateEmbedding();
             }
         }
     }

     function showMap(j) {
         data=j;
         T.iter=0;
         T.initDataRaw(data.vecs); // init embedding
         drawEmbedding(); // draw initial embedding

         if(iter_id >= 0) {
             clearInterval(iter_id);
         }
         //T.debugGrad();
         iter_id = setInterval(step, 1);
         if(true) { // (<%= $show_som %>) {
             makeSOM(j, <%= $no_iterations %>);
         }
     }
     var queryword;

     function onload() {
         queryword = document.getElementById('word');
     }

     function queryKorAP() {
         window.open('http://korap.ids-mannheim.de/kalamar/?q='+queryword.value, 'KorAP');
     }

     function queryKorAPCII(query) {
         window.open('http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q='+query, 'KorAP');
     }
    </script>
  </head>
  <body onload="onload()">
    <div id="header">
      <div id="pagetitle">
        <h1>DeReKo-Vectors</h1>
      </div>
      <div id="options"  class="widget">
        <form id="queryform">
          <input id="word" type="text" name="word"  placeholder="Word(s) to be searched" value="<%= $word %>"
                 title="When looking for multiple words use spaces as separators to search around the average vector and | as separator to get the neighbours for each word."/>
          <input id="SEARCH" type="button" value="SEARCH">
          <input type="button" id="showoptions" name="showoptions" value="Options" />
        </form>
        <div id="dropdownoptions" style="display: none">
          <form id="optionsform">
            <div class="controlgroup-vertical">
              <label for="cutoff">cut-off</label>
              <input id="cutoff" type="text" name="cutoff" size="10"  value="<%= $cutoff %>" title="Only consider the most frequent x word forms.">
              <label for="dedupe">dedupe</label>
              <input id="dedupe" type="checkbox" name="dedupe" value="1" <%= ($dedupe ? "checked" : "") %> title="radically filter out any near-duplicates">
              % if($mergedEnd > 0) {
                <label for="sbf">backw.</label>
                <input id="sbf" type="checkbox" name="sbf" value="1" <%= ($searchBaseVocabFirst ? "checked" : "") %> title="If checkecked base vocabulary will be searched first. Otherwise merged vocabulray will be searched first.">
              % }
              <label for="neighbours">max. neighbours:</label>
              <input id="neighbours" size="4" name="n" value="<%= $no_nbs %>">
              <label for="no_iterations">max. iterations</label>
              <input id="no_iterations" name="N" size="4" value="<%= $no_iterations %>">
              <!-- <label for="dosom">SOM</label>
                   <input id="dosom" type="checkbox" name="som" value="1" <%= ($show_som ? "checked" : "") %>> -->
              % if($collocators) {
                <label for="sortby">window/sort</label>
                <select id="sortby" name="sort">
                  <option value="0"  <%= ($sort!=1 && $sort!=2? "selected":"") %>>auto focus</option>
                  <!-- <option value="1"  <%= ($sort==1? "selected":"") %>>any single position</option>
                       <option value="2" <%= ($sort==2? "selected":"") %>>whole window</option> -->
                </select>
              % }
              <input type="button" value="→ KorAP" onclick="queryKorAP();" title="query word with KorAP"/>
            </div>
          </form>
        </div>
      </div>
    </div>
    <div id="topwrapper">
      <div style="visibility: hidden;" id="tabs">
        <ul>
          <li><a href="#tabs-1">Semantics (TSNE-map)</a></li>
          <li><a href="#tabs-2">Semantics (SOM)</a></li>
          <li><a href="#tabs-3">Syntagmatic (collocators)</a></li>
        </ul>
        <div id="tabs-1">
          % if($lists && (@$lists) > 0 && (@$lists)[0]) {
            <div id="wrapper">
              <div id="first" style="width: 320px">
                <table class="display compact nowrap" id="firsttable">
                  <thead>
                    <tr>
                      <th align="right">#</th><th align="right">cos</th><th align="left">similars</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td align="right">
                      </td>
                      <td align="right">
                      </td>
                      <td></td>
                    </tr>
                  </tbody>
                </table>
              </div>
              <script>
              </script>
              <div id="second">
                <div id="embed">
                </div>
                <div id="cost">
                </div>
              </div>
            </div>
          % } elsif($word !~ /^\s*$/) {
          <div id="wrapper">
            <div id="not-found-dialog" title="Not found">
              <p>ERROR: "<%= $word %>" not found in vocabluary.</p>
              <p>If you are sure you have spelled the word as intended, you can try to increase the cutoff parameter in the options menu.</p>
            </div>
            <script>
             $( function() {
                 $( "#not-found-dialog" ).dialog({
                     autoOpen: true,
                     modal: true,
                     draggable: false,
                     height: "auto",
                     width: "auto",
                     resizable: false,
                     buttons: {
                         "OK": function() {
                             $( this ).dialog( "close" );
                         },
                         "Apply": function() {
                             window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
                         }
                     }
                 });
             });
            </script>
          </div>
            % }
        </div>
        <div id="tabs-2">
          <div id="som2" style="width: 800; height: 800px">
          </div>
          <div id="sominfo1"><span id="somcolor1">   </span> <span id="somword1"> </span> <span id="somcolor2">   </span> <span id="somword2"> </span> <span id="somcolor3">   </span></div>
          <div id="sominfo">SOM iteration <span id="iterations">0</span></div>
        </div>
        <div id="tabs-3">
          <div style="width: 800px" id="secondt">
            <table class="display compact nowrap" id="secondtable">
              <thead>
                <tr>
                  % if($collocators) {
                    <th>#</th>
                    <th align="center" title="The columns (c) around the target are considered for summation are marked with *.">w'</th>
                    <th align="right" title="Raw (max.) activation of the collocator in the output layers.">max(a)</th>
                    <th title="Co-normalized raw activation sum of the collocator in the selected columns." align="right">⊥Σa</th>
                    <th title="Sum of activations over the selected colunns normalized by the total activation sum of the selected columns." align="right">Σa/Σc</th>
                    <th title="Sum of the column normalized activations over the selected colunns." align="right">Σ(a/c)</th>
                    <th title="Sum of the activations over the whole window normalized by the total window sum (no auto-focus)." align="right">Σa/Σw</th>
                    <th align="left">collocator</th>
                  % }
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td align="right">
                  </td>
                  <td align="right">
                  </td>
                  <td align="right">
                  </td>
                  <td align="right">
                  </td>
                  <td align="right">
                  </td>
                  <td align="right">
                  </td>
                  <script
                    src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
                      </td>
                </tr>
              </tbody>
            </table>
          </div> <!-- - tab2 -->
        </div> <!-- tabs -->
      </div>
    </div> <!-- topwrapper  -->
    <div style="clear: both;"></div>
    </div>
    % if($training_args) {
      <p>
        Word vector model trained with <a href="https://code.google.com/p/word2vec/">word2vec</a> using the following parameters: <pre><%= $training_args %></pre>
      </p>
    % }
  </body>
</html>
