forked from GitHub/gf-core
Catalan in android app builder ; updated app document with Cat ; substitute voice output for Bulgarian and Catalan ; replaced brackets in unknown words by capitalization (for better speech output ; this is experimental)
This commit is contained in:
@@ -3,8 +3,12 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
The Human Language Compiler is a translator for human language based on
|
The Human Language Compiler is a translator for human language based on
|
||||||
programming language technology. Therefore it is compact in size
|
programming language technology: grammars and semantics. Therefore it is compact in size
|
||||||
and gives control on quality. It indicates confidence with colours:
|
and gives control on quality.
|
||||||
|
<p>
|
||||||
|
The app is small (under 30 MB for all languages off-line translation). We do not show ads.
|
||||||
|
</p>
|
||||||
|
The app indicates translation confidence with colours:
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>Green</b>:
|
<li><b>Green</b>:
|
||||||
semantic translation, should be correct.
|
semantic translation, should be correct.
|
||||||
@@ -41,20 +45,22 @@ The following table gives a rough idea of what to expect:
|
|||||||
<table rules=all border=yes>
|
<table rules=all border=yes>
|
||||||
<tr> <th></th> <th>coverage</th> <th>quality</th> <th>speed</th> <th>speech</th> </tr>
|
<tr> <th></th> <th>coverage</th> <th>quality</th> <th>speed</th> <th>speech</th> </tr>
|
||||||
<tr> <th>Bulgarian</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=palegreen></td> <td bgcolor=yellow>in only</td></tr>
|
<tr> <th>Bulgarian</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=palegreen></td> <td bgcolor=yellow>in only</td></tr>
|
||||||
|
<tr> <th>Catalan</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=yellow>in only</td></tr>
|
||||||
<tr> <th>Chinese</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=palegreen></td> <td bgcolor=yellow>diff in/out</td> </tr>
|
<tr> <th>Chinese</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=palegreen></td> <td bgcolor=yellow>diff in/out</td> </tr>
|
||||||
<tr> <th>Dutch</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> </tr>
|
<tr> <th>Dutch</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> </tr>
|
||||||
<tr> <th>English</th> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> </tr>
|
<tr> <th>English</th> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> </tr>
|
||||||
<tr> <th>Finnish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
<tr> <th>Finnish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
||||||
<tr> <th>French</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
<tr> <th>French</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=red></td> <td bgcolor=palegreen></td></tr>
|
||||||
<tr> <th>German</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
<tr> <th>German</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
||||||
<tr> <th>Hindi</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=yellow></td> <td bgcolor=yellow>out only</td> </tr>
|
<tr> <th>Hindi</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=yellow></td> <td bgcolor=yellow>out only</td> </tr>
|
||||||
<tr> <th>Italian</th> <td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
<tr> <th>Italian</th> <td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
||||||
<tr> <th>Spanish</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
<tr> <th>Spanish</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
||||||
<tr> <th>Swedish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> </tr>
|
<tr> <th>Swedish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> </tr>
|
||||||
</table>
|
</table>
|
||||||
</center>
|
</center>
|
||||||
This is new and experimental technology, and we are constantly working
|
<b>Bulgarian</b> uses Russian voice for output,
|
||||||
on the app. Expect frequent updates and improvements!
|
<b>Catalan</b> uses a Spanish voice.
|
||||||
|
<b>Chinese</b> uses Mandarin for input and Cantonese for output.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@@ -74,10 +80,11 @@ To activate it go to Settings > Language & input.
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
The Human Languge Compiler works <b>completely off-line</b>, without
|
The Human Languge Compiler works <b>completely off-line</b>, without
|
||||||
internet connection, although being on-line may give you better
|
internet connection, when doing text-based translation.
|
||||||
|
Even speech works off-line in some languages,
|
||||||
|
but being on-line may give you better
|
||||||
speech input and output.
|
speech input and output.
|
||||||
The app is small (around 23 MB for all languages).
|
You can also install third-party off-line speech engines, such as SVOX.
|
||||||
We do not show ads.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -22,10 +22,22 @@ public class TTS {
|
|||||||
|
|
||||||
// TODO: handle speak() calls before service connects
|
// TODO: handle speak() calls before service connects
|
||||||
public void speak(String language, String text) {
|
public void speak(String language, String text) {
|
||||||
if (mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) {
|
|
||||||
|
|
||||||
|
if (mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) {
|
||||||
|
|
||||||
|
/* hack for missing TTS */
|
||||||
|
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")) {
|
if (language.equals("cmn-Hans-CN")) {
|
||||||
language = "yue";
|
language = "yue";
|
||||||
}
|
}
|
||||||
|
|
||||||
Locale locale = LocaleUtils.parseJavaLocale(language.replace('-', '_'),
|
Locale locale = LocaleUtils.parseJavaLocale(language.replace('-', '_'),
|
||||||
Locale.getDefault());
|
Locale.getDefault());
|
||||||
|
|
||||||
|
|||||||
@@ -28,27 +28,6 @@ public class Translator {
|
|||||||
|
|
||||||
private static final String TAG = "Translator";
|
private static final String TAG = "Translator";
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
// old
|
|
||||||
|
|
||||||
// TODO: allow changing
|
|
||||||
private String mGrammar = "ParseEngAbs.pgf";
|
|
||||||
|
|
||||||
// TODO: build dynamically?
|
|
||||||
private Language[] mLanguages = {
|
|
||||||
new Language("en-US", "English", "ParseEng", R.xml.qwerty),
|
|
||||||
new Language("bg-BG", "Bulgarian", "ParseBul", R.xml.cyrillic),
|
|
||||||
new Language("cmn-Hans-CN", "Chinese", "ParseChi", R.xml.qwerty),
|
|
||||||
new Language("fr-FR", "French", "ParseFre", R.xml.qwerty),
|
|
||||||
new Language("de-DE", "German", "ParseGer", R.xml.qwerty),
|
|
||||||
new Language("hi-IN", "Hindi", "ParseHin", R.xml.devanagari_page1, R.xml.devanagari_page2),
|
|
||||||
new Language("sv-SE", "Swedish", "ParseSwe", R.xml.qwerty),
|
|
||||||
new Language("fi-FI", "Finnish", "ParseFin", R.xml.qwerty),
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
// /*
|
|
||||||
// new
|
// new
|
||||||
|
|
||||||
// TODO: allow changing
|
// TODO: allow changing
|
||||||
@@ -56,10 +35,13 @@ public class Translator {
|
|||||||
|
|
||||||
// TODO: build dynamically?
|
// TODO: build dynamically?
|
||||||
private Language[] mLanguages = {
|
private Language[] mLanguages = {
|
||||||
new Language("en-US", "English", "AppEng", R.xml.qwerty),
|
|
||||||
new Language("bg-BG", "Bulgarian", "AppBul", R.xml.cyrillic),
|
new Language("bg-BG", "Bulgarian", "AppBul", R.xml.cyrillic),
|
||||||
|
new Language("ca-ES", "Catalan", "AppCat", R.xml.qwerty),
|
||||||
new Language("cmn-Hans-CN", "Chinese", "AppChi", R.xml.qwerty),
|
new Language("cmn-Hans-CN", "Chinese", "AppChi", R.xml.qwerty),
|
||||||
|
// new Language("yue", "Chinese (Cantonese)", "AppChi", R.xml.qwerty),
|
||||||
|
// new Language("cmn-Hans-CN", "Chinese (Mandarin)", "AppChi", R.xml.qwerty),
|
||||||
new Language("nl-NL", "Dutch", "AppDut", R.xml.qwerty),
|
new Language("nl-NL", "Dutch", "AppDut", R.xml.qwerty),
|
||||||
|
new Language("en-US", "English", "AppEng", R.xml.qwerty),
|
||||||
new Language("fi-FI", "Finnish", "AppFin", R.xml.nordic),
|
new Language("fi-FI", "Finnish", "AppFin", R.xml.nordic),
|
||||||
new Language("fr-FR", "French", "AppFre", R.xml.qwerty),
|
new Language("fr-FR", "French", "AppFre", R.xml.qwerty),
|
||||||
new Language("de-DE", "German", "AppGer", R.xml.qwerty),
|
new Language("de-DE", "German", "AppGer", R.xml.qwerty),
|
||||||
@@ -68,7 +50,6 @@ public class Translator {
|
|||||||
new Language("es-ES", "Spanish", "AppSpa", R.xml.qwerty),
|
new Language("es-ES", "Spanish", "AppSpa", R.xml.qwerty),
|
||||||
new Language("sv-SE", "Swedish", "AppSwe", R.xml.nordic),
|
new Language("sv-SE", "Swedish", "AppSwe", R.xml.nordic),
|
||||||
};
|
};
|
||||||
// */
|
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
@@ -267,7 +248,7 @@ public class Translator {
|
|||||||
|
|
||||||
private String translateWord(String input) {
|
private String translateWord(String input) {
|
||||||
|
|
||||||
String output = "[" + input + "]" ; // if all else fails, return the word itself in brackets
|
String output = input.toUpperCase() ; // if all else fails, return the word itself in upper case ///in brackets
|
||||||
Concr sourceLang = getSourceConcr() ;
|
Concr sourceLang = getSourceConcr() ;
|
||||||
Concr targetLang = getTargetConcr() ;
|
Concr targetLang = getTargetConcr() ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user