diff --git a/cat/concordia_gate.php_pattern b/cat/concordia_gate.php_pattern index d3ccbf3..4318f09 100644 --- a/cat/concordia_gate.php_pattern +++ b/cat/concordia_gate.php_pattern @@ -2,7 +2,7 @@ $url = 'http://@concordia_host@:@concordia_port@'; $intervalsArray = array(); -$data = array("operation" => $_POST["operation"],"tmId" => intval($_POST["tmId"]),"pattern" => $_POST["pattern"],"intervals" => $intervalsArray); +$data = array("operation" => $_POST["operation"],"tmId" => intval($_POST["tmId"]),"limit" => intval($_POST["limit"]),"offset" => intval($_POST["offset"]),"pattern" => $_POST["pattern"],"intervals" => $intervalsArray); // use key 'http' even if you send the request to https://... $options = array( diff --git a/cat/favicon.ico b/cat/favicon.ico index 1f57aac..b1d2d27 100644 Binary files a/cat/favicon.ico and b/cat/favicon.ico differ diff --git a/cat/index.html_pattern b/cat/index.html_pattern index 9b5ff1d..19f8b43 100644 --- a/cat/index.html_pattern +++ b/cat/index.html_pattern @@ -45,6 +45,10 @@
+ + +
+
diff --git a/cat/js/cat.js b/cat/js/cat.js index 610edb7..adbd362 100644 --- a/cat/js/cat.js +++ b/cat/js/cat.js @@ -1,3 +1,69 @@ +var pageLimit = 20; + +function secondStepSearch(caller) { + var fullSearchRequest = { + operation: 'fullSearch', + tmId: currentTmId, + limit: pageLimit, + offset: $('#current-offset').val(), + pattern:caller.innerHTML + } + + $.ajax({ + url: '/cat/concordia_gate.php', + type: 'post', + dataType: 'json', + success: function (data) { + presentFullSearchResults(data); + }, + data: fullSearchRequest + }); + +} + +function presentFullSearchResults(data) { + var pattern = $('#current-pattern').val(); + var offset = parseInt($('#current-offset').val()); + var begin = offset+1; + var end = offset + pageLimit; + var totalCount = parseInt(data['result']['totalCount']); + if (end > totalCount) { + end = totalCount; + } + + var result = 'Showing results '+begin+' - '+end+' of '+totalCount+'
'; + + for (j=0;j0: shutil.copytree('js', root_dir+'/js') shutil.copytree('css', root_dir+'/css') shutil.copytree('images', root_dir+'/images') -shutil.copy('favicon.ico', root_dir+'/favicon.ico') +shutil.copy('favicon.ico', '/var/www/html/favicon.ico') config = dict() diff --git a/cat/versions_available/europarl_sample.cfg b/cat/versions_available/europarl_sample.cfg index d6a4004..99cafcf 100644 --- a/cat/versions_available/europarl_sample.cfg +++ b/cat/versions_available/europarl_sample.cfg @@ -1,7 +1,7 @@ dir@#@europarl_sample concordia_host@#@localhost concordia_port@#@8800 -tmid@#@2 +tmid@#@1 desc@#@Welcome to the interactive Concordia demo. The system finds the longest matches of the pattern sentence in its translation memory. This translation memory is over 1.5M sentences taken from English-Polish corpus of European Law (Europarl + JRC-Acquis). Please enter an English sentence in the field below and press Enter (or use the search button). This instance of Concordia works best with law sentences, but is very likely to output some results for any English sentence. You can also use predefined samples, simply use the link "show/hide samples" and apply one of the sample sentences. After the search, click on the highlighted fragments to see their context. enjoy@#@Enjoy your work with the system! prompt@#@Enter search pattern (English sentence): diff --git a/cat/versions_enabled/europarl_sample.cfg b/cat/versions_enabled/europarl_sample.cfg new file mode 120000 index 0000000..c90ed2e --- /dev/null +++ b/cat/versions_enabled/europarl_sample.cfg @@ -0,0 +1 @@ +../versions_available/europarl_sample.cfg \ No newline at end of file diff --git a/cat/versions_enabled/jrc_enes.cfg b/cat/versions_enabled/jrc_enes.cfg deleted file mode 120000 index 8eec574..0000000 --- a/cat/versions_enabled/jrc_enes.cfg +++ /dev/null @@ -1 +0,0 @@ -../versions_available/jrc_enes.cfg \ No newline at end of file diff --git a/cat/versions_enabled/stocznia_plen.cfg b/cat/versions_enabled/stocznia_plen.cfg deleted file mode 120000 index 0ba3868..0000000 --- a/cat/versions_enabled/stocznia_plen.cfg +++ /dev/null @@ -1 +0,0 @@ -../versions_available/stocznia_plen.cfg \ No newline at end of file diff --git a/db/recreateDb.sh b/db/recreateDb.sh index 9bce649..380b2ab 100755 --- a/db/recreateDb.sh +++ b/db/recreateDb.sh @@ -1,13 +1,13 @@ #!/bin/sh echo "Recreating database schema..." -psql -U concordia -p 6543 -h localhost concordia_server -f concordia_server.sql +PGPASSWORD=concordia psql -U concordia -p 6543 -h localhost concordia_server -f concordia_server.sql echo "Inserting initial data..." for initFile in `ls init/*` do echo "Init file:" $initFile - psql -U concordia -p 6543 -h localhost concordia_server -f $initFile + PGPASSWORD=concordia psql -U concordia -p 6543 -h localhost concordia_server -f $initFile done echo "Concordia server database recreation complete!" diff --git a/startAll.sh b/startAll.sh new file mode 100755 index 0000000..facad13 --- /dev/null +++ b/startAll.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +cd db +./startPGbouncer.sh +cd .. + +mono LemmaGenSockets/LemmaGenSockets/bin/Debug/LemmaGenSockets.exe & + +scripts/start.sh \ No newline at end of file diff --git a/tests/addAlignedLemmatizedTM.py b/tests/addAlignedLemmatizedTM.py index aecc7dd..26f2960 100755 --- a/tests/addAlignedLemmatizedTM.py +++ b/tests/addAlignedLemmatizedTM.py @@ -58,6 +58,7 @@ data = { req = urllib2.Request(address) req.add_header('Content-Type', 'application/json') response = json.loads(urllib2.urlopen(req, json.dumps(data)).read()) +print(response) tmId = int(response['newTmId']) print "Added new tm: %d" % tmId diff --git a/tests/addLemmatizedTM.sh b/tests/addLemmatizedTM.sh index b581e3c..8cb99b0 100755 --- a/tests/addLemmatizedTM.sh +++ b/tests/addLemmatizedTM.sh @@ -1,7 +1,7 @@ #!/bin/sh -CORPUS_NAME="jrc_enes" +CORPUS_NAME="europarl_sample" SRC_LANG_ID=2 -TRG_LANG_ID=4 +TRG_LANG_ID=1 ./addAlignedLemmatizedTM.py $CORPUS_NAME ../mgiza-aligner/corpora/$CORPUS_NAME/src_final.txt $SRC_LANG_ID ../mgiza-aligner/corpora/$CORPUS_NAME/trg_final.txt $TRG_LANG_ID ../mgiza-aligner/corpora/$CORPUS_NAME/aligned_final.txt