now the app shows the correct abstract syntax names for unknown words while it still produces the right TTS

This commit is contained in:
krasimir
2015-08-06 14:19:13 +00:00
parent 26c2f12170
commit a33e06649d
2 changed files with 1 additions and 1 deletions

View File

@@ -148,7 +148,6 @@ public class ConversationView extends ScrollView {
// unknown linearizations in output: darkest red color. But replace [ ] by spaces and remove _ for better speech synthesis
else if (target.toString().contains("[")) {
view.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_worst_utterance_bg));
target = target.toString().replace('[',' ').replace(']',' ').replaceAll("_","").trim();
}
// parse by domain grammar, marked by +, green color

View File

@@ -323,6 +323,7 @@ public class MainActivity extends Activity {
if (DBG) Log.d(TAG, "Speaking: " + res.first);
CharSequence text2 =
mConversationView.addSecondPersonUtterance(input, text, alts);
text2 = text2.toString().replace('[',' ').replace(']',' ').replaceAll("_","").trim();
mTts.speak(getTargetLanguageCode(), text2.toString());
hideProgressBar();