mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-29 14:32:51 -06:00
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:
@@ -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"}])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user