mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-15 15:59:32 -06:00
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:
@@ -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() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user