derekovecs: adjustemnts for english models
diff --git a/templates/index.html.ep b/templates/index.html.ep
index 0b19de5..36a2b65 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -2,7 +2,7 @@
<html>
<head>
<% my $plain_title = $title; $plain_title=~s/<[^>]+>//g; %>
- <title><%= $plain_title %>:<%= $word %> DeReKo-Word-Vector-Distances</title>
+ <title><%= $plain_title %>:<%= $word %> · IDS word vector analysis</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>
@@ -29,7 +29,11 @@
var currentWords = urlParams.get("word");
var CIIsearchWords = (currentWords && currentWords.includes(" ") ? '('+currentWords.replace(/ +/g, " oder ")+')' : currentWords);
var collocatorTable = null;
-
+ var plainTitle ="<%= $plain_title %>"
+ var korapPath="/";
+ if (plainTitle.match(/-en/)) {
+ korapPath="/instance/english";
+ }
$(document).ready(function() {
$('#firstable').hide();
@@ -93,7 +97,7 @@
function changeCharColor(txt, heat, word) {
var newText = "";
for (var i=0, l=txt.length; i<l; i++) {
- newText += (i == 5 ? txt.charAt(i) : '<a href="http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q=' +
+ newText += (i == 5 ? txt.charAt(i) : '<a href="http://korap.ids-mannheim.de' + korapPath + '/?ql=cosmas2&q=' +
CIIsearchWords + ' /' + (i > 5? '%2B' : '-') + 'w' +
Math.abs(i-5) + ':' + Math.abs(i-5) + ' ' + word +
'" target="korap"><span style="background-color:' +
@@ -156,7 +160,7 @@
"dom": '<"top">rt<"bottom"flp><"clear">',
"initComplete":function(settings, json) {
$('td.paradigmator a').on('mousedown', function(e) {
- return paradigmatorClick(e, paraResults[0][0].word, this.childNodes["0"].textContent);
+ return paradigmatorClick(e, paraResults[0][0].word, this.childNodes["0"].textContent);
});
},
"columns": [
@@ -282,10 +286,11 @@
// var filterQuot = /(^quot?=[A-Z])|(quot$)/g;
var filterQuot = /^quot/;
var ccResult;
+ var baseURL = window.location.pathname.replace(/[/]$/, '')
classicCollocatorTable = $('#classicoloctable').DataTable({
ajax: {
method: "GET",
- url: '/derekovecs/getClassicCollocators',
+ url: baseURL + '/getClassicCollocators',
dataType: 'json',
dataSrc: function (result) {
ccResult = result;
@@ -719,6 +724,7 @@
var queryword;
function showCollocatorSOM() {
+ var baseURL = window.location.pathname.replace(/[/]$/, '')
if (collocatorTable) {
var ctableData = collocatorTable.rows().data();
var nwords = [],
@@ -727,7 +733,7 @@
nranks.push(ctableData[i].rank);
nwords.push(ctableData[i].word);
}
- $.post('/derekovecs/getVecsByRanks',
+ $.post(baseURL+'/getVecsByRanks',
JSON.stringify(nranks),
function(data, status){
showMap({target: " "+urlParams.get('word')+" ", mergedEnd: <%= $mergedEnd %>, words: nwords, vecs: data, ranks: nranks, marked: Array(100).fill(false)} );
@@ -740,11 +746,11 @@
}
function queryKorAP() {
- window.open('http://korap.ids-mannheim.de/kalamar/?q='+queryword.value, 'KorAP');
+ window.open('http://korap.ids-mannheim.de' + korapPath + '?q='+queryword.value, 'KorAP');
}
function queryKorAPCII(query) {
- window.open('http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q='+query, 'KorAP');
+ window.open('http://korap.ids-mannheim.de' +korapPath + '?ql=cosmas2&q='+query, 'KorAP');
}
</script>
</head>
diff --git a/w2v-server.pl b/w2v-server.pl
index 0fecbae..22d94dc 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -107,6 +107,7 @@
sub fname2corpusname {
($_) = @_;
s@.*/@@;
+ s@\.en@-en@;
s@\..*@@;
return $_;
}