diff --git a/cat/index.html_pattern b/cat/index.html_pattern index 3f31986..6955bf8 100644 --- a/cat/index.html_pattern +++ b/cat/index.html_pattern @@ -6,6 +6,21 @@ +
diff --git a/cat/js/cat.js b/cat/js/cat.js index d7b5466..0ddc88c 100644 --- a/cat/js/cat.js +++ b/cat/js/cat.js @@ -1,16 +1,3 @@ -var concordiaUrl = 'http://localhost'; - -$(document).ready(function() { - $('#searchInput').bind("enterKey",function(e){ - searchHandle(); - }); - $('#searchInput').keyup(function(e){ - if(e.keyCode == 13) { - $(this).trigger("enterKey"); - } - }); -}); - function searchHandle(tmid) { var concordiaRequest = { operation: 'concordiaSearch', diff --git a/cat/versions/jrc_enes.cfg b/cat/versions/jrc_enes.cfg index 6400912..baf8abe 100644 --- a/cat/versions/jrc_enes.cfg +++ b/cat/versions/jrc_enes.cfg @@ -1,5 +1,7 @@ dir@#@jrc_enes -tmid@#@1 +concordia_host@#@concordia.vm.wmi.amu.edu.pl +concordia_port@#@8800 +tmid@#@2 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 200 000 sentences taken from English-Spanish corpus of European Law. 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. prompt@#@Enter search pattern (English sentence): suggestion@#@Every ship in the European Union must have a crew of 50 or more workers. diff --git a/cat/versions/setimes_hren.cfg b/cat/versions/setimes_hren.cfg index 964c185..8985d89 100644 --- a/cat/versions/setimes_hren.cfg +++ b/cat/versions/setimes_hren.cfg @@ -1,5 +1,7 @@ dir@#@setimes_hren -tmid@#@2 +concordia_host@#@concordia.vm.wmi.amu.edu.pl +concordia_port@#@8800 +tmid@#@1 desc@#@Welcome to Concordia. The system finds the longest matches of the pattern sentence in its translation memory. This translation memory is 200 000 sentences taken from the SETIMES2 Croatian-English corpus (link). Please enter a Croatian sentence in the field below and press Enter (or use the search button). You can test the system on predefined samples, simply use the link "show/hide samples" and apply one of the sample sentences. prompt@#@Enter search pattern (Croatian sentence): suggestion@#@Kazna medijskom mogulu obnovila raspravu u Makedoniji diff --git a/tests/remote/addFile.py b/tests/remote/addFile.py deleted file mode 100755 index 903e8cb..0000000 --- a/tests/remote/addFile.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import unittest -import json -import urllib2 -import sys -import time - -BUFFER_SIZE = 500 - -def file_len(fname): - with open(fname) as f: - for i, l in enumerate(f): - pass - return i + 1 - -def add_data(data): - req = urllib2.Request('http://concordia.vm.wmi.amu.edu.pl:8800/') - req.add_header('Content-Type', 'application/json') - urllib2.urlopen(req, json.dumps(data)).read() - -sourceFile = sys.argv[1] -targetFile = sys.argv[2] -tmId = int(sys.argv[3]) - -totalLines = file_len(sourceFile) -if file_len(targetFile) != totalLines: - print "File lengths do not match" - sys.exit(1) - -data = { - 'operation': 'addSentences' -} - -sentences = [] -start = time.time() -with open(sys.argv[1]) as sourceSentences: - with open(sys.argv[2]) as targetSentences: - lineNumber = 0 - for sourceSentence in sourceSentences: - lineNumber += 1 - targetSentence = targetSentences.readline() - sentences.append([tmId, sourceSentence, targetSentence]) - if lineNumber % BUFFER_SIZE == 0: - data['sentences'] = sentences - sentences = [] - add_data(data) - mark = time.time() - print "Added %d of %d sentences. Time elapsed: %.4f s, current speed: %.4f sentences/second" % (lineNumber, totalLines, mark-start, lineNumber/(mark-start)) - - -if len(sentences) > 0: - data['sentences'] = sentences - add_data(data) - -end = time.time() -print "Added all %d sentences. Time elapsed: %.4f s, overall speed: %.4f sentences/second" % (lineNumber, end-start, lineNumber/(end-start)) - -print "Generating index..." -start = time.time() -data = { - 'operation': 'refreshIndex' -} -req = urllib2.Request('http://concordia.vm.wmi.amu.edu.pl:8800/') -req.add_header('Content-Type', 'application/json') -urllib2.urlopen(req, json.dumps(data)).read() - -end = time.time() -print "Index regeneration complete. The operation took %.4f s" % (end - start) - - - diff --git a/tests/remote/addSentence.py b/tests/remote/addSentence.py deleted file mode 100755 index 4388873..0000000 --- a/tests/remote/addSentence.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import unittest -import json -import urllib2 -import sys -import time - -data = { - 'operation': 'addSentence', - 'sourceSentence':sys.argv[1], - 'targetSentence':sys.argv[2], - 'tmId':sys.argv[3] -} - -start = time.time() -req = urllib2.Request('http://concordia.vm.wmi.amu.edu.pl:8800/') -req.add_header('Content-Type', 'application/json') -response = json.loads(urllib2.urlopen(req, json.dumps(data)).read()) -end = time.time() - -print "Execution time: %.4f seconds." % (end-start) -print "Result: " -print response - - diff --git a/tests/remote/concordiaSearch.py b/tests/remote/concordiaSearch.py deleted file mode 100755 index 10c8654..0000000 --- a/tests/remote/concordiaSearch.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import unittest -import json -import urllib2 -import sys -import time - -data = { - 'operation': 'concordiaSearch', - 'pattern':sys.argv[1] -} - -start = time.time() -req = urllib2.Request('http://concordia.vm.wmi.amu.edu.pl:8800/') -req.add_header('Content-Type', 'application/json') -response = json.loads(urllib2.urlopen(req, json.dumps(data)).read()) -end = time.time() - -print "Execution time: %.4f seconds." % (end-start) -print "Result: " -print response - - diff --git a/tests/remote/generateIndex.py b/tests/remote/generateIndex.py deleted file mode 100755 index d6ec977..0000000 --- a/tests/remote/generateIndex.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import unittest -import json -import urllib2 -import sys -import time - -print "Generating index..." -start = time.time() -data = { - 'operation': 'refreshIndex' -} -req = urllib2.Request('http://concordia.vm.wmi.amu.edu.pl:8800/') -req.add_header('Content-Type', 'application/json') -urllib2.urlopen(req, json.dumps(data)).read() - -end = time.time() -print "Index regeneration complete. The operation took %.4f s" % (end - start) - - - diff --git a/tests/remote/simpleSearch.py b/tests/remote/simpleSearch.py deleted file mode 100755 index 5627b70..0000000 --- a/tests/remote/simpleSearch.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import unittest -import json -import urllib2 -import sys -import time - -data = { - 'operation': 'simpleSearch', - 'pattern':sys.argv[1] -} - -start = time.time() -req = urllib2.Request('http://concordia.vm.wmi.amu.edu.pl:8800/') -req.add_header('Content-Type', 'application/json') -response = json.loads(urllib2.urlopen(req, json.dumps(data)).read()) -end = time.time() - -print "Execution time: %.4f seconds." % (end-start) -print "Result: " -print response - -