1
0
forked from GitHub/gf-core

the dictionary view in the app now filters out duplicated morphological analyses

This commit is contained in:
kr.angelov
2014-05-22 07:10:28 +00:00
parent 9e0a1bff64
commit 2528952d42

View File

@@ -286,6 +286,25 @@ public class MainActivity extends Activity {
private void handleSpeechInput(final String input) {
final List<MorphoAnalysis> list = mTranslator.lookupMorpho(input);
// filter out duplicates
int i = 0;
while (i < list.size()) {
MorphoAnalysis an = list.get(i);
boolean found = false;
for (int j = 0; j < i; j++) {
if (list.get(j).getLemma().equals(an.getLemma())) {
found = true;
break;
}
}
if (found)
list.remove(i);
else {
i++;
}
}
mConversationView.updateLastUtterance(input);
new AsyncTask<Void,Void,Pair<String,List<ExprProb>>>() {
@Override