diff --git a/src/www/js/wc.js b/src/www/js/wc.js index c32d0f2e8..99fcf2edb 100644 --- a/src/www/js/wc.js +++ b/src/www/js/wc.js @@ -2,12 +2,14 @@ /* --- Wide Coverage Translation Demo web app ------------------------------- */ var wc={} -//wc.cnl="Phrasebook" // try this controlled natural language first +wc.selected_cnls=[] // list of grammar names +wc.cnls={} // maps grammars names to {pgf_online:...,grammar_info:{...}} wc.f=document.forms[0] wc.o=element("output") wc.e=element("extra") wc.i=element("grammarinfo") wc.p=element("pick") +wc.grammarbox=element("grammarbox") wc.os=[] /* output segment list [{input,text:String; from,to::Lang; target:Node; @@ -42,6 +44,7 @@ wc.save=function() { wc.local.put("to",f.to.value) wc.local.put("input",f.input.value) wc.local.put("colors",f.colors.checked) + wc.local.put("cnls",wc.selected_cnls) } } @@ -52,6 +55,7 @@ wc.load=function() { f.from.value=wc.local.get("from",f.from.value) f.to.value=wc.local.get("to",f.to.value) f.colors.checked=wc.local.get("colors",f.colors.checked) + wc.selected_cnls=wc.local.get("cnls",wc.selected_cnls) wc.colors() wc.delayed_translate() } @@ -249,25 +253,31 @@ wc.translate=function() { gftranslate.translate(text,f.from.value,wc.languages || f.to.value,i,count,step3) } function step2(text) { trans(text,0,10) } - function step2cnl(text) { + function step2cnl(text,ix) { function step3cnl(results) { var trans=results[0].translations if(trans && trans.length>=1) { for(var i=0;i Demo: GF Wide Coverage Translation + @@ -44,6 +45,8 @@ span.inflect { color: blue; }

GF Wide Coverage Translation Demo

+
+
@@ -87,6 +90,7 @@ span.inflect { color: blue; } Colors +
@@ -109,7 +113,7 @@ span.inflect { color: blue; }

-Last modified: Fri Nov 27 10:47:46 CET 2015 +Last modified: Thu May 12 15:32:41 CEST 2016
About