From dbdcff1fac26acf9e2b223cc6fb4e4d4d9e300aa Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 5 Dec 2014 09:23:44 +0000 Subject: [PATCH] fixes in app help file ; commented out fake TTS for Bul and Cat ; remove []_ from output with unlinearized functions, so that speech doesn't get garbled. --- src/ui/android/assets/help_content.html | 62 ++++++++++++------- src/ui/android/project.properties | 2 +- .../ui/android/ConversationView.java | 10 ++- .../grammaticalframework/ui/android/TTS.java | 4 +- 4 files changed, 50 insertions(+), 28 deletions(-) diff --git a/src/ui/android/assets/help_content.html b/src/ui/android/assets/help_content.html index 45281ce2d..0ea34df15 100644 --- a/src/ui/android/assets/help_content.html +++ b/src/ui/android/assets/help_content.html @@ -2,22 +2,22 @@

-Speech input: Press microphone icon and talk. +Speech input: Tap microphone icon and talk while it is red.
-Text input: Select "keyboard" from menu, press keyboard icon. +Text input: Select "keyboard" from menu, tap keyboard icon.
-Correction: Press input text. +Correction: Tap input text.
-Alternatives: Press output text +Alternatives: Tap output text
-Grammar info: Press any of alternatives. +Grammar info: Tap any of the alternatives.
Confidence: colour of output text

@@ -27,15 +27,18 @@

The Human Language Compiler is a translator for human language based on programming language technology: grammars and semantics. Therefore it is compact in size -and gives control on quality. +and gives control on quality. Most other translator are based on +statistics and have less controll of quality and either require +an internet connection or have a much bigger size.

-The app is small (under 30 MB for all languages off-line translation). We do not show ads. +The app is small (under 30 MB for all languages in off-line translation). We do not show ads.

The app indicates translation confidence with colours: The green translations come from a tourist phrasebook, which allows you to translate things like "hello" and "how far is the airport from -the hotel". But this part can be easily adapted to other uses, such as -technical language. +the hotel".

-You can translate both speech and text, as selected in the menu in the upper right corner. -Translation works between any pair of the supported languages, which means 110 +You can translate both speech and text, as selected in the menu in the +upper right corner. Both kinds of input can be edited with the +keyboard by first tapping at the input field. This is often needed +because of speech recognition errors. Changing words +from upper to lower case may also be needed. +

+

+Translation works between any pair of the supported languages, which means 132 language pairs at the moment. But different languages are on different levels of development. The following table gives a rough idea of what to expect:

@@ -69,21 +77,25 @@ The following table gives a rough idea of what to expect: coverage quality speed speech Bulgarian in only Catalan in only - Chinese diff in/out + Chinese diff in/out* Dutch English - Finnish + Finnish in only French German - Hindi out only + Hindi in only Italian Spanish - Swedish + Swedish in only -Bulgarian uses Russian voice for output, -Catalan uses a Spanish voice. -Chinese uses Mandarin for input and Cantonese for output. +*Chinese uses Mandarin for input and Cantonese for output. +

+

+The speech input and output use Google's voice services. Their status +can hence change without notice. You can make it more stable by +installing third-party speech tools, such as SVOX, which also provides +output in Finnish and Swedish.

@@ -112,11 +124,13 @@ You can also install third-party off-line speech engines, such as SVOX.

Powered by GF, +based on open-source software, built by support from the GF community and from Digital Grammars.

-Digital Grammars can tailor this app to you needs - tell us what you want to see +Digital Grammars can tailor this app to you needs and provide good +translation for the kind of vocabulary you need. Just tell us what you want to see in the green area!

diff --git a/src/ui/android/project.properties b/src/ui/android/project.properties index ce39f2d0a..6e18427a4 100644 --- a/src/ui/android/project.properties +++ b/src/ui/android/project.properties @@ -11,4 +11,4 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-18 +target=android-21 diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/ConversationView.java b/src/ui/android/src/org/grammaticalframework/ui/android/ConversationView.java index 712418898..716523462 100644 --- a/src/ui/android/src/org/grammaticalframework/ui/android/ConversationView.java +++ b/src/ui/android/src/org/grammaticalframework/ui/android/ConversationView.java @@ -140,11 +140,17 @@ public class ConversationView extends ScrollView { target = target.subSequence(1, target.length()).toString().trim(); } - // parse error or unknown translations (in []) present, darkest red color - else if (target.toString().contains("parse error:") || target.toString().contains("[")) { + // parse error: darkest red color + else if (target.toString().contains("parse error:")) { view.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_worst_utterance_bg)); } + // 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 else if (target.charAt(0) == '+') { view.setBackgroundDrawable(getResources().getDrawable(R.drawable.second_person_best_utterance_bg)); diff --git a/src/ui/android/src/org/grammaticalframework/ui/android/TTS.java b/src/ui/android/src/org/grammaticalframework/ui/android/TTS.java index 4b9242af6..d52315fec 100644 --- a/src/ui/android/src/org/grammaticalframework/ui/android/TTS.java +++ b/src/ui/android/src/org/grammaticalframework/ui/android/TTS.java @@ -26,13 +26,15 @@ public class TTS { if (mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) { - /* hack for missing TTS */ + /* hack for missing TTS -- don't use for official release! if (language.equals("bg-BG")) { language = "ru-RU"; } if (language.equals("ca-ES")) { language = "es-ES"; // hardly politically correct... } + */ + /* OR use separate entries for Cantonese and Mandarin */ if (language.equals("cmn-Hans-CN")) { language = "yue";