diff options
-rw-r--r-- | img/institut_cl.png | bin | 0 -> 3301 bytes | |||
-rw-r--r-- | img/logo_neu_204x107.jpg | bin | 0 -> 14111 bytes | |||
-rw-r--r-- | index.php | 36 | ||||
-rwxr-xr-x | kill | 4 | ||||
-rw-r--r-- | lfpe.css | 30 | ||||
-rw-r--r-- | lfpe.js | 14 | ||||
-rwxr-xr-x | server.rb | 4 |
7 files changed, 69 insertions, 19 deletions
diff --git a/img/institut_cl.png b/img/institut_cl.png Binary files differnew file mode 100644 index 0000000..6c56df6 --- /dev/null +++ b/img/institut_cl.png diff --git a/img/logo_neu_204x107.jpg b/img/logo_neu_204x107.jpg Binary files differnew file mode 100644 index 0000000..870dcb4 --- /dev/null +++ b/img/logo_neu_204x107.jpg @@ -10,29 +10,45 @@ <div id="wrapper"> -<div> - <textarea id="src" name="source" cols="1" rows="1" readonly></textarea> +<div id="header"> +<img src="img/logo_neu_204x107.jpg" /> +<img id="cl" src="img/institut_cl.png" /> </div> -<div> - <textarea id="trgt" name="target" cols="1" rows="1" onkeypress="submit(event)"></textarea> -</div> +<table> +<tr> + <td align="right">Source:</td> + <td><textarea id="src" name="source" cols="80" rows="1" readonly></textarea></td> +</tr> +<tr> + <td align="right">Target:</td> + <td><textarea id="trgt" name="target" cols="80" rows="1" onkeypress="submit(event)"></textarea></td> +</tr> +</table> <p> <button id="next" type="button" onclick="Next()">Next</button> </p> +<p id="desc"> +<strong>Help</strong><br /> +Press the 'Next' to submit your post-edit and to request the next segment to translate +(or just press enter when the 'Target' textarea is in focus). +</p> + +<p id="footer"> + ©2015 Heidelberg University/Institute for Computational Linguistics +</p> + </div> + <p id="translating_status"> - <strong>translating</strong> <img src="img/ajax-loader-large.gif" width="20px" /> + <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> +<textarea style="display:none" id="src_pp"></textarea> </body> </html> @@ -0,0 +1,4 @@ +#!/bin/bash + +for i in {1..6}; do ps ax | grep -P "(server.rb|atools|net_fa|sa.extract|dtrain)" | grep -v vim | grep -v -P "^\s\+$" | cut -d " " -f $i | xargs kill -9; done + @@ -5,7 +5,7 @@ textarea { p#translating_status { display: none; margin-left: 4.2em; - margin-top: -5.5em + /*margin-top: -5.5em*/ } button { @@ -20,14 +20,38 @@ p#fi { } div#wrapper { - margin: 4em; + margin: 2em; padding: 1em; border: 1px dashed #000 } +div#header { + margin-bottom: 2em; +} + +p#footer { + text-align:right; + font-size: 0.5em; + font-weight:bold; + margin:0; + padding:0; + color:#ccc +} + p#desc { font-size:0.8em; + width:40%; color: #ccc; - position: fixed + text-align:justify +} + +p#desc:hover { + color: #000 +} + +img#cl { + margin-bottom:20px; + margin-left:10px; + vertical-align:bottom; } @@ -28,7 +28,7 @@ function Next() url = "http://coltrane.cl.uni-heidelberg.de:60666/next"; var pe = document.getElementById("trgt").value; if (pe != "") { - var src = document.getElementById("src").value; + var src = document.getElementById("src_pp").value; url += "?example="+src+" %7C%7C%7C "+pe; } document.getElementById("translating_status").style.display = "block"; @@ -47,10 +47,14 @@ function Next() document.getElementById("next").innerHTML = "Thank you!"; document.getElementById("next").disabled = true; } else { - document.getElementById("src").value = x[0]; - document.getElementById("src").cols = x[0].length; - document.getElementById("trgt").value = x[1]; - document.getElementById("trgt").cols = x[1].length; + document.getElementById("src_pp").value = x[0]; + document.getElementById("src").value = x[2]; + document.getElementById("src").rows = Math.round(x[2].length/80)+1; + var firstLetter = x[1][0].toUpperCase(); + var rest = x[1].substring(1); + var t = firstLetter + rest; + document.getElementById("trgt").value = t; + document.getElementById("trgt").rows = Math.round(x[1].length/80)+1; document.getElementById("translating_status").style.display = "none"; document.getElementById("trgt").focus(); document.getElementById("trgt").selectionStart = 0; @@ -8,6 +8,7 @@ require 'digest' require_relative "#{ARGV[0]}" INPUT = ReadFile.readlines INPUT_FILE +INPUT_RAW = ReadFile.readlines RAW_INPUT_FILE `mkdir -p #{WORK_DIR}/g` def start_daemon cmd, name, addr @@ -102,6 +103,7 @@ get '/next' do STDERR.write "[extractor] < got '#{env[:extractor][:socket].recv}'\n" end source = INPUT.shift + raw_source = INPUT_RAW.shift if !source # input is done -> displays 'Thank you!' STDERR.write ">>> end of input, sending 'fi'\n" "fi" @@ -121,7 +123,7 @@ get '/next' do STDERR.write "[dtrain] waiting for translation ...\n" transl = env[:dtrain][:socket].recv.force_encoding "UTF-8" STDERR.write "[dtrain] < received translation: '#{transl}'\n" - "#{source}\t#{transl}" + "#{source}\t#{transl.strip}\t#{raw_source}" end end |