1
0
forked from GitHub/gf-core

edits in App help ; name suggestion "Language Compiler" ; sepApo(), a quick fix to French and Italian elision in the App

This commit is contained in:
aarne
2014-04-15 22:02:06 +00:00
parent 7527edf2d5
commit 5fe4536925
3 changed files with 34 additions and 12 deletions

View File

@@ -2,12 +2,13 @@
<body>
<p>
DG Translator is a compact and completely off-line translator.
We do not show adds and we do not require internet connection.
However, if you want to use speech translation, then it might
work better if you are on-line. We use existing
Android speech services which may not be fully functional off-line.
In all cases you can always use keyboard input.
We do not show ads and we do not require internet connection.
However, if you encounter problems with the speech translation input
or output, it may work better if you are on-line.
In all cases you can always use keyboard input, also for editing the
speech input.
</p>
<p>
We indicate the translation confidence with colours:
<ul>
@@ -30,13 +31,13 @@ We indicate the translation confidence with colours:
</ul>
The translation works between any pair of the supported languages.
However, it works best <b>from English</b> and also from Swedish.
From other languages it can be slow and give more red.
From other languages it can be slow and give more red results.
But expect frequent updates and improvements!
</p>
<p>
When you tab on a translation you get a screen with <b>alternative translations</b>.
If the input is only a single word, then taping on each of the alternatives
gives you grammatical and morphological information for the word.
When you tap on a translation you get a screen with <b>alternative translations</b>.
If the input is only a single word, then tapping on each of the alternatives
gives you <b>grammatical information</b> about the word.
</p>
<p>
The app also provides an <b>input method</b> which you can use as
@@ -46,8 +47,12 @@ To activate it go to Settings > Language &amp; input.
</p>
<p>
Powered by <a href="http://www.grammaticalframework.org/">GF</a>,
built by <a href="http://www.digitalgrammars.com/">Digital Grammars</a>
built by <a href="http://www.digitalgrammars.com/">Digital Grammars</a>.
</p>
<p>
<i>Digital Grammars can tailor this app to you needs - tell us what you want to see
in the green area!</i>
</p>
</body>
</body>
</html>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">DG Translator</string>
<string name="app_name">Language Compiler</string>
<string name="microphone">Microphone</string>
<string name="switch_languages">Switch languages</string>

View File

@@ -265,6 +265,16 @@ public class Translator {
return out;
}
private static String sepApo(String in) {
String out = "";
for (int i = 0; i < in.length(); i++) {
out += in.charAt(i);
if (in.charAt(i) == '\'')
out += ' ';
}
return out;
}
private String translateWord(String input) {
String output = "[" + input + "]" ; // if all else fails, return the word itself in brackets
@@ -311,6 +321,13 @@ public class Translator {
// for Chinese we need to put space after every character
input = explode(input);
}
if (getSourceLanguage().getLangCode().equals("fr-FR")) {
// for French and Italian we need to separate apostrophe by space...
input = sepApo(input);
}
if (getSourceLanguage().getLangCode().equals("it-IT")) {
input = sepApo(input);
}
String output = null;
List<ExprProb> exprs = new ArrayList<ExprProb>();