PGF web service: add lexer support

The PGF web API commands parse, translate, translategroup, c-parse and
c-translate now support a lexer parameter. Possible values are "text",
"code" and "mixed".

This is used in the Wide Coverage Demo App to save one server roundtrip.
This commit is contained in:
hallgren
2014-04-08 16:10:33 +00:00
parent 8c3d91f405
commit 0341fd035f
3 changed files with 34 additions and 14 deletions

View File

@@ -20,7 +20,7 @@ gftranslate.translate=function(source,from,to,start,limit,cont) {
function extract(result) { cont(result[0].translations) }
if(encsrc.length<500)
gftranslate.call("?command=c-translate&input="+encsrc
+"&from="+g+from+"&to="+g+to
+"&lexer=text&from="+g+from+"&to="+g+to
+"&start="+start+"&limit="+limit,extract)
else cont([{error:"sentence too long"}])
}