Wide Coverage Translation Demo: draw syntax trees

The trees are drawn by using the Haskell run-time request 

	AppEng.pgf?command=abstrtree&tree=...

Thus AppEng.pgf has to be installed on the server and in sync with App14.pgf.
This is to avoid loading the huge App14.pgf in the Haskell run-time system, and
is enough since we only need the abstract syntax.
This commit is contained in:
hallgren
2015-03-18 16:23:04 +00:00
parent 9af20d5c8b
commit e92583ca8c

View File

@@ -110,7 +110,17 @@ wc.translate=function() {
wc.selected=so
var r=so.rs[so.current_pick]
var prob=r.prob<=0 ? "" : r.prob || ""
if(e) e.innerHTML=prob+"<br>"+(r.tree||"")
if(e) {
e.innerHTML=prob+"<br>"
if(r.tree) {
var t=wrap("span",text(r.tree))
var imgurl="/robust/AppEng.pgf?command=abstrtree&tree="+encodeURIComponent(r.tree)+"&format=svg"
e.appendChild(t)
if(!r.img) r.img=node("img",{src:imgurl},[])
e.appendChild(empty("br"))
e.appendChild(r.img)
}
}
if(wc.p /*&& so.rs.length>1*/) show_picks()
//if(f.speak.checked) wc.speak(t.text,f.to.value)
if(!so.got_more) {