mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-14 15:29:31 -06:00
make sure that the app doesn't crash even if nonExist is used somewhere in the grammars
This commit is contained in:
@@ -312,13 +312,19 @@ public class Translator {
|
||||
} catch (ParseError e) {
|
||||
output = translateByLookup(input);
|
||||
}
|
||||
|
||||
if (output == null)
|
||||
output = "% "; // make sure that we return something
|
||||
|
||||
return new Pair<String,List<ExprProb>>(output, exprs);
|
||||
}
|
||||
|
||||
public String linearize(Expr expr) {
|
||||
Concr targetLang = getTargetConcr();
|
||||
return targetLang.linearize(expr);
|
||||
String s = targetLang.linearize(expr);
|
||||
if (s == null)
|
||||
s = "% "; // make sure that we return something
|
||||
return s;
|
||||
}
|
||||
|
||||
public Object[] bracketedLinearize(Expr expr) {
|
||||
|
||||
Reference in New Issue
Block a user