mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
ui/android/.../Translate.java uses Parse8 (change the name and language list if you need something else)
This commit is contained in:
@@ -26,20 +26,20 @@ public class Translator {
|
|||||||
private static final String TAG = "Translator";
|
private static final String TAG = "Translator";
|
||||||
|
|
||||||
// TODO: allow changing
|
// TODO: allow changing
|
||||||
private String mGrammar = "ParseEngAbs.pgf";
|
private String mGrammar = "Parse8.pgf";
|
||||||
/// private String mGrammar = "TranslateEngChiFinSwe.pgf"; // AR
|
|
||||||
|
|
||||||
// TODO: build dynamically?
|
// TODO: build dynamically?
|
||||||
private Language[] mLanguages = {
|
private Language[] mLanguages = {
|
||||||
/*
|
|
||||||
new Language("en-US", "English", "TranslateEng", R.xml.inflection_en), // AR
|
new Language("en-US", "English", "ParseEng", R.xml.inflection_en, R.xml.qwerty),
|
||||||
new Language("cmn-Hans-CN", "Chinese", "TranslateChi", R.xml.inflection_cmn),
|
|
||||||
new Language("fi-FI", "Finnish", "TranslateFin", R.xml.inflection_fi, R.xml.qwerty),
|
|
||||||
new Language("sv-SE", "Swedish", "TranslateSwe", R.xml.inflection_sv),
|
|
||||||
*/
|
|
||||||
new Language("en-US", "English", "ParseEng", R.xml.inflection_en, R.xml.qwerty),
|
|
||||||
new Language("bg-BG", "Bulgarian", "ParseBul", R.xml.inflection_bg, R.xml.cyrillic),
|
new Language("bg-BG", "Bulgarian", "ParseBul", R.xml.inflection_bg, R.xml.cyrillic),
|
||||||
|
new Language("cmn-Hans-CN", "Chinese", "ParseChi", R.xml.inflection_cmn, R.xml.qwerty),
|
||||||
|
new Language("fi-FI", "Finnish", "ParseFin", R.xml.inflection_fi2, R.xml.qwerty),
|
||||||
|
new Language("fr-FR", "French", "ParseFre", 0, R.xml.qwerty),
|
||||||
|
new Language("de-DE", "German", "ParseGer", 0, R.xml.qwerty),
|
||||||
|
new Language("hi-IN", "Hindi", "ParseHin", 0, R.xml.qwerty), ///
|
||||||
new Language("sv-SE", "Swedish", "ParseSwe", R.xml.inflection_sv, R.xml.qwerty),
|
new Language("sv-SE", "Swedish", "ParseSwe", R.xml.inflection_sv, R.xml.qwerty),
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
@@ -129,7 +129,7 @@ public class Translator {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Concr sourceLang = getConcr(getSourceLanguage().getConcrete());
|
Concr sourceLang = getConcr(getSourceLanguage().getConcrete());
|
||||||
Expr expr = sourceLang.parseBest(getGrammar().getStartCat(), input);
|
Expr expr = sourceLang.parseBest(getGrammar().getStartCat(), input);
|
||||||
Concr targetLang = getConcr(getTargetLanguage().getConcrete());
|
Concr targetLang = getConcr(getTargetLanguage().getConcrete());
|
||||||
String output = targetLang.linearize(expr);
|
String output = targetLang.linearize(expr);
|
||||||
return output;
|
return output;
|
||||||
|
|||||||
Reference in New Issue
Block a user