added API in the C runtime and the Java binding for checking whether a given function is linearizable in a given language. This is used in the Android UI for better vizualizations

This commit is contained in:
kr.angelov
2013-11-27 12:35:11 +00:00
parent eeec31cbab
commit b0a74ddc59
6 changed files with 31 additions and 28 deletions

View File

@@ -211,8 +211,7 @@ public class LexicalEntryActivity extends ListActivity {
TextView descView =
(TextView) convertView.findViewById(R.id.lexical_desc);
Expr e = Expr.readExpr(lemma);
String phrase = mTranslator.generateTranslationEntry(e);
String phrase = mTranslator.generateTranslationEntry(lemma);
descView.setText(phrase);
convertView.setOnClickListener(new OnClickListener() {

View File

@@ -131,10 +131,14 @@ public class Translator {
}
}
public String generateTranslationEntry(Expr e) {
public String generateTranslationEntry(String lemma) {
Expr e = Expr.readExpr(lemma);
Concr sourceLang = getConcr(getSourceLanguage().getConcrete());
Concr targetLang = getConcr(getTargetLanguage().getConcrete());
return sourceLang.linearize(e) + " - " + targetLang.linearize(e);
if (targetLang.hasLinearization(lemma))
return sourceLang.linearize(e) + " - " + targetLang.linearize(e);
else
return sourceLang.linearize(e);
}
public Map<String,String> tabularLinearize(Expr e) {