diff options
-rw-r--r-- | index.php | 12 | ||||
-rw-r--r-- | lfpe.css | 14 | ||||
-rw-r--r-- | lfpe.js | 16 | ||||
-rw-r--r-- | model/grammar.gz | bin | 121 -> 153 bytes | |||
-rwxr-xr-x | model/run | 9 | ||||
-rw-r--r-- | model/src.gz | bin | 70 -> 128 bytes | |||
-rw-r--r-- | server.rb | 4 |
7 files changed, 49 insertions, 6 deletions
@@ -8,22 +8,32 @@ <body onload="Next()"> +<div id="wrapper"> + <div> <textarea id="src" name="source" cols="1" rows="1" readonly></textarea> </div> <div> - <textarea id="trgt" name="target" cols="1" rows="1"></textarea> + <textarea id="trgt" name="target" cols="1" rows="1" onkeypress="submit(event)"></textarea> </div> <p> <button id="next" type="button" onclick="Next()">Next</button> </p> +</div> + <p id="translating_status"> <strong>translating</strong> <img src="img/ajax-loader-large.gif" width="20px" /> </p> +<p id="desc"> +Press the 'Next' to submit your post-edit and request the next segment to translate +(or just press enter when the textarea is in focus). +</p> + + </body> </html> @@ -4,6 +4,8 @@ textarea { p#translating_status { display: none; + margin-left: 4.2em; + margin-top: -5.5em } button { @@ -17,3 +19,15 @@ p#fi { display: none; } +div#wrapper { + margin: 4em; + padding: 1em; + border: 1px dashed #000 +} + +p#desc { + font-size:0.8em; + color: #ccc; + position: fixed +} + @@ -14,9 +14,18 @@ function CreateCORSRequest(method, url) { return xhr; } -function Next(url) +function submit(e) { + if (e.keyCode == 13) { + e.preventDefault(); + Next(); + } + + return false; +} + +function Next() { - url = "http://localhost:31337/next"; + url = "http://coltrane.cl.uni-heidelberg.de:60666/next"; var pe = document.getElementById("trgt").value; if (pe != "") { var src = document.getElementById("src").value; @@ -43,6 +52,9 @@ function Next(url) document.getElementById("trgt").value = x[1]; document.getElementById("trgt").cols = x[1].length; document.getElementById("translating_status").style.display = "none"; + document.getElementById("trgt").focus(); + document.getElementById("trgt").selectionStart = 0; + document.getElementById("trgt").selectionEnd = 0; } }; diff --git a/model/grammar.gz b/model/grammar.gz Binary files differindex 84eb73c..8c5f570 100644 --- a/model/grammar.gz +++ b/model/grammar.gz @@ -1,4 +1,11 @@ #!/bin/bash -x -~/src/cdec_net/training/dtrain/dtrain_net_interface -c dtrain.ini -a ipc:///tmp/dtrain.ipc +export LD_LIBRARY_PATH=/fast_scratch/simianer/lfpe/nanomsg-0.5-beta/lib + +while true; do +/fast_scratch/simianer/lfpe/cdec_net/training/dtrain/dtrain_net_interface -c dtrain.ini -a ipc:///tmp/dtrain.ipc &>dtrain.out & +PID=$! +sleep 600 +kill $PID +done diff --git a/model/src.gz b/model/src.gz Binary files differindex 9aa247f..3f8f895 100644 --- a/model/src.gz +++ b/model/src.gz @@ -5,8 +5,8 @@ require 'sinatra/cross_origin' require 'nanomsg' require 'zipf' -set :bind, '0.0.0.0' -set :port, 31337 +set :bind, '147.142.207.52' +set :port, 60666 set :allow_origin, :any set :allow_methods, [:get, :post, :options] |