mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-04 16:52:50 -06:00
Wide coverage translation demo: show an informative error message for sentences that exceed the length limit
This commit is contained in:
@@ -197,6 +197,8 @@ wc.translate=function() {
|
||||
var r=tra[0]
|
||||
r.prob = -1
|
||||
if(r.linearizations) showit(r,gftranslate.grammar)
|
||||
else if(r.error!=undefined)
|
||||
show_error(r.error)
|
||||
}
|
||||
else if(so.rs.length==0)
|
||||
show_error("Unable to translate")
|
||||
@@ -210,7 +212,7 @@ wc.translate=function() {
|
||||
var r=tra[0]
|
||||
if(r.error!=undefined) {
|
||||
if(i==0 && so.rs.length==0) {
|
||||
//show_error(tra[0].error)
|
||||
//show_error(r.error)
|
||||
word_for_word(text)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user