summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/www/js/gfrobust.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/www/js/gfrobust.js b/src/www/js/gfrobust.js
index fde72998b..9e0e0d929 100644
--- a/src/www/js/gfrobust.js
+++ b/src/www/js/gfrobust.js
@@ -14,8 +14,10 @@ gfrobust.call=function(querystring,cont) {
// Translate a sentence to the given target language
gfrobust.translate=function(source,to,cont) {
- var enc=encodeURIComponent
- gfrobust.call("?sentence="+enc(source)+"&to="+gfrobust.grammar+to,cont)
+ var encsrc=encodeURIComponent(source)
+ if(encsrc.length<200) // match limit in runtime/c/utils/pgf-server.c
+ gfrobust.call("?sentence="+encsrc+"&to="+gfrobust.grammar+to,cont)
+ else cont("[GF robust parser: sentence too long]")
}
// Get the url of a parse tree image (SVG)