From 6601a3972e54b6dd36877355fb21c82d3fbcbd91 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 11 Apr 2014 15:00:15 +0000 Subject: Simple Translator: use colors to indicate translation quality --- src/www/js/wc.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src/www/js/wc.js') diff --git a/src/www/js/wc.js b/src/www/js/wc.js index 14593d1b5..af60475be 100644 --- a/src/www/js/wc.js +++ b/src/www/js/wc.js @@ -1,5 +1,5 @@ var wc={} -//wc.cnl="Phrasebook" // try this controlled natural language first +wc.cnl="Phrasebook" // try this controlled natural language first wc.f=document.forms[0] wc.o=element("output") wc.e=element("extra") @@ -59,22 +59,6 @@ wc.translate=function() { return s.split(/([.!?]+[ \t\n]+|\n\n+|[ \t\n]*[-•*+#]+[ \t\n]+)/) } - function trans_quality(r) { - var text=r.linearizations[0].text - if(r.prob==0) return {quality:"high_quality",text:text} - else { - var quality="default_quality" - switch(text[0]) { - case '+': text=text.substr(1); quality="high_quality"; break; - case '*': text=text.substr(1); quality="low_quality"; break; - default: - if(r.tree[0]=="?") quality="low_quality" - } - text=text.trimLeft() - return {quality:quality,text:text} - } - } - function translate_segment(si) { // si = segment index var rs=[] // list of alternative translations for this segment var current_pick=0 // index of currently selected alternative -- cgit v1.2.3