simple translator: Replaced 'GF Robust Parser' with 'GF Wide Coverage Translation'

The interface to the wide coverage translation is in js/gftranslate.js
and it assumes that the grammar is installed on the cloud server
as /robust/Translate8.pgf.

The list of supported languages is hardwired in gftranslate.js, since
there is no support for obtaining this info from the C run-time system
at the moment.
This commit is contained in:
hallgren
2014-01-21 16:47:23 +00:00
parent db67c180a5
commit 7cf6391ee1
3 changed files with 46 additions and 10 deletions

View File

@@ -118,7 +118,7 @@ Translator.prototype.update_language_menus=function() {
mark_menus(yes,yes)
break;
case "GFRobust":
if(window.gfrobust) gfrobust.get_support(mark_menus)
if(window.gftranslate) gftranslate.get_support(mark_menus)
else mark_menus(no,no)
break;
case "Apertium":
@@ -217,9 +217,9 @@ Translator.prototype.update_translation=function(i) {
//console.log(translate_output)
upd2(translate_output,punct)
}
gfrobust.translate(source,o.to,upd1)
gftranslate.translate(source,o.from,o.to,upd1)
}
if(!window.gfrobust)
if(!window.gftranslate)
upd3s("[GF robust parser is not available]")
else {
function check_support(ssupport,tsupport) {
@@ -243,7 +243,7 @@ Translator.prototype.update_translation=function(i) {
upd3s("["+msg+"]")
}
}
gfrobust.get_support(check_support)
gftranslate.get_support(check_support)
}
}
@@ -937,7 +937,7 @@ Translator.prototype.draw_segment_given_target=function(s,target,i) {
}
var autoB=radiobutton("method","Default","Default",change)
var manualB=radiobutton("method","Manual","Manual",change)
var gfrobustB=radiobutton("method","GFRobust","GF Robust Parser",change)
var gfrobustB=radiobutton("method","GFRobust","GF Wide Coverage Translation",change)
var dl=wrap_class("dl","popupmenu",
[dt(autoB),
dt([manualB,text(" "),draw_translation(o)]),
@@ -969,17 +969,19 @@ Translator.prototype.draw_segment_given_target=function(s,target,i) {
var source=wrap_class("td","source",txt)
if(!t.document.globalsight)
txt.onclick=function() { t.edit_source(source,i); }
if(window.gfrobust && segment_method(t.document,s)=="GFRobust") {
/*
if(window.gftranslate && segment_method(t.document,s)=="GFRobust") {
function add_button(src) {
var btn=img("../minibar/tree-btn.png")
btn.className="right"
btn.other=gfrobust.parsetree_url(src)
btn.other=gftranslate.parsetree_url(src)
btn.title="Click to toggle parse tree view."
btn.onclick=function() { toggle_img(btn) }
source.appendChild(btn)
}
lexgfrobust(s.source,add_button)
}
*/
var options=wrap_class("td","options",draw_options())
return node("tr",{"class":"segment",id:i},[actions,source,options,target])