From c398b1e794cada1558eb10c1d09573e184269de2 Mon Sep 17 00:00:00 2001 From: hallgren Date: Wed, 21 Jan 2015 16:02:37 +0000 Subject: [PATCH] Wide Coverage Translation Demo: use App13.pgf, adding support for Japanese Japanese uses the same lexer as Chinese, i.e. every character is a separate token. --- src/www/js/gftranslate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/www/js/gftranslate.js b/src/www/js/gftranslate.js index e061554b6..c25d6859e 100644 --- a/src/www/js/gftranslate.js +++ b/src/www/js/gftranslate.js @@ -3,7 +3,7 @@ var gftranslate = {} -gftranslate.jsonurl="/robust/App12.pgf" +gftranslate.jsonurl="/robust/App13.pgf" gftranslate.grammar="App" // the name of the grammar gftranslate.call=function(querystring,cont,errcont) { @@ -20,7 +20,7 @@ function enc_langs(g,to) { gftranslate.translate=function(source,from,to,start,limit,cont) { var g=gftranslate.grammar var lexer="&lexer=text" - if(from=="Chi") lexer="",source=source.split("").join(" ") + if(from=="Chi" || from=="Jpn") lexer="",source=source.split("").join(" ") var encsrc=encodeURIComponent(source) function errcont(text,code) { cont([{error:code+" "+text}]) } function extract(result) { cont(result[0].translations) }