forked from GitHub/gf-core
the dictionary view in the Android app now shows both the source and the target linearizations
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
package org.grammaticalframework.ui.android;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ListActivity;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -22,8 +18,6 @@ import android.view.ViewGroup.LayoutParams;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -76,8 +70,6 @@ public class LexicalEntryActivity extends ListActivity {
|
||||
|
||||
List<String> data = new ArrayList<String>();
|
||||
for (MorphoAnalysis a : list) {
|
||||
Expr e = Expr.readExpr(a.getLemma());
|
||||
|
||||
if (!data.contains(a.getLemma())) {
|
||||
data.add(a.getLemma());
|
||||
}
|
||||
@@ -220,7 +212,7 @@ public class LexicalEntryActivity extends ListActivity {
|
||||
(TextView) convertView.findViewById(R.id.lexical_desc);
|
||||
|
||||
Expr e = Expr.readExpr(lemma);
|
||||
String phrase = mTranslator.linearize(e);
|
||||
String phrase = mTranslator.generateTranslationEntry(e);
|
||||
descView.setText(phrase);
|
||||
|
||||
convertView.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.AsyncTask;
|
||||
@@ -17,7 +16,6 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import org.grammaticalframework.ui.android.ASR.State;
|
||||
|
||||
@@ -131,9 +131,10 @@ public class Translator {
|
||||
}
|
||||
}
|
||||
|
||||
public String linearize(Expr e) {
|
||||
public String generateTranslationEntry(Expr e) {
|
||||
Concr sourceLang = getConcr(getSourceLanguage().getConcrete());
|
||||
Concr targetLang = getConcr(getTargetLanguage().getConcrete());
|
||||
return targetLang.linearize(e);
|
||||
return sourceLang.linearize(e) + " - " + targetLang.linearize(e);
|
||||
}
|
||||
|
||||
public Map<String,String> tabularLinearize(Expr e) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package org.grammaticalframework.ui.android;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.grammaticalframework.ui.android.TranslatorKeyboard;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
Reference in New Issue
Block a user