Gujarati
This commit is contained in:
parent
240e5c444a
commit
e3d0bac90f
13 changed files with 1380245 additions and 18 deletions
15
app/languages/definitions/Gujarati.yml
Normal file
15
app/languages/definitions/Gujarati.yml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
locale: gu-IN
|
||||
dictionaryFile: gu-utf8.csv
|
||||
abcString: કખગ
|
||||
hasUpperCase: no
|
||||
layout:
|
||||
- [SPECIAL] # 0
|
||||
- [્, ઼, ઃ, ઽ, ૐ, PUNCTUATION_IN] # 1 ==> [halant, nuqta, avagraha, visarga, om]
|
||||
- [અ, આ, બ, ભ, ચ, છ, ા] # 2 ==> [a, aa, b, bh, c, ch, aa (m)]
|
||||
- [દ, ધ, ડ, ઢ, એ, ઐ, ઍ, ફ, ે, ૈ, ૅ] # 3 ==> [d, dh, ḍ (dd), ḍh (ddh), e, ai, ae, ph, e (m), ai (m), ae (m)]
|
||||
- [ગ, ઘ, હ, ઇ, ઈ, િ, ી] # 4 ==> [g, gh, h, i, ii, i (m), ii (m) ]
|
||||
- [જ, ઝ, ક, ખ, લ, ળ, ઌ, ૢ] # 5 ==> [j, jh, k, kh, l, ḷ (ll), l̥, l̥ (m)]
|
||||
- [મ, ઙ, ઞ, ણ, ન, ઓ, ઑ, ઔ, ો, ૉ, ૌ, ં, ઁ] # 6 ==> [m, ṅ (ng), ñ, ṇ (nn), n, o, ŏ, au, o (m), ŏ (m), au (m), anusvara, m̐ (m-combining with vowel, e.g. "am", "em")]
|
||||
- [પ, ર, ઋ, સ, શ, ષ, ૃ, ૄ] # 7 ==> [p, r, r̥, s, sh, ss, r̥ (m), rr (m)]
|
||||
- [ત, થ, ટ, ઠ, ઉ, ઊ, વ, ુ, ૂ] # 8 ==> [t, th, ṭ (tt), ṭh, u, uu, v, u (m), uu (m)]
|
||||
- [ય] # 9 ==> [y]
|
||||
1380080
app/languages/dictionaries/gu-utf8.csv
Normal file
1380080
app/languages/dictionaries/gu-utf8.csv
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -17,11 +17,7 @@ class LocaleWordsSorter {
|
|||
|
||||
|
||||
LocaleWordsSorter(@Nullable Language language) {
|
||||
if (LanguageKind.isHindi(language)) {
|
||||
sortingPattern = Pattern.compile("[\\u0904-\\u0939\\u0958-\\u0961][\\u0900-\\u0904\\u093A-\\u094F\\u0962\\u0963]+");
|
||||
} else {
|
||||
sortingPattern = null;
|
||||
}
|
||||
sortingPattern = LanguageKind.isIndic(language) ? Pattern.compile("\\p{L}\\p{M}+") : null;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,17 +5,19 @@ import java.util.Locale;
|
|||
public class LanguageKind {
|
||||
public static final int KOREAN = 601579;
|
||||
|
||||
public static boolean isArabic(Language language) { return language != null && language.getId() == 502337; }
|
||||
public static boolean isCyrillic(Language language) { return language != null && language.getKeyCharacters(2).contains("а"); }
|
||||
public static boolean isLatinBased(Language language) { return language != null && language.getKeyCharacters(2).contains("a"); }
|
||||
public static boolean isRTL(Language language) { return isArabic(language) || isHebrew(language); }
|
||||
|
||||
public static boolean isArabic(Language language) { return language != null && language.getId() == 502337; }
|
||||
public static boolean isEnglish(Language language) { return language != null && language.getLocale().equals(Locale.ENGLISH); }
|
||||
public static boolean isFrench(Language language) { return language != null && language.getId() == 596550; }
|
||||
public static boolean isGreek(Language language) { return language != null && language.getId() == 597381; }
|
||||
public static boolean isGujarati(Language language) { return language != null && language.getId() == 468647; }
|
||||
public static boolean isHebrew(Language language) { return language != null && (language.getId() == 305450 || language.getId() == 403177); }
|
||||
public static boolean isHindi(Language language) { return language != null && language.getId() == 468264; }
|
||||
public static boolean isIndic(Language language) { return isHindi(language); }
|
||||
public static boolean isHinglish(Language language) { return language != null && language.getId() == 468421; }
|
||||
public static boolean isIndic(Language language) { return isGujarati(language) || isHindi(language); }
|
||||
public static boolean isKorean(Language language) { return language != null && language.getId() == KOREAN; }
|
||||
public static boolean isLatinBased(Language language) { return language != null && language.getKeyCharacters(2).contains("a"); }
|
||||
public static boolean isRTL(Language language) { return isArabic(language) || isHebrew(language); }
|
||||
public static boolean isUkrainian(Language language) { return language != null && language.getId() == 54645; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,9 +211,12 @@ public class SoftKeyNumber extends SoftKey {
|
|||
// Greek diacritics and ending sigma
|
||||
|| currentLetter == 'ς'
|
||||
|| (isGreek && (currentLetter < 'α' || currentLetter > 'ω'))
|
||||
// Hindi matras
|
||||
// Hindi combining
|
||||
|| (currentLetter >= 0x0900 && currentLetter <= 0x0903) || (currentLetter >= 0x093A && currentLetter <= 0x094F)
|
||||
|| (currentLetter >= 0x0951 && currentLetter <= 0x0957) || currentLetter == 0x0962 || currentLetter == 0x0963
|
||||
// Gujarati combining
|
||||
|| (currentLetter >= 0x0A81 && currentLetter <= 0x0A83) || (currentLetter >= 0xABC && currentLetter <= 0x0ACD)
|
||||
|| currentLetter == 0x0AE2 || currentLetter == 0x0AE3
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,10 +25,13 @@ class Punctuation {
|
|||
',', '-', '\'', ':', ';', '!', '?', '.'
|
||||
));
|
||||
|
||||
final private static ArrayList<Character> CombiningPunctuationIndic = new ArrayList<>(Arrays.asList(
|
||||
'्', '़', 'ऽ', 'ः', '।', '॰', '॥'
|
||||
final private static ArrayList<Character> CombiningPunctuationGujarati = new ArrayList<>(Arrays.asList(
|
||||
'્', '઼', 'ઽ', 'ઃ', '।', '॰', '॥' // Indic combining chars look the same, but have different Unicode values
|
||||
));
|
||||
|
||||
final private static ArrayList<Character> CombiningPunctuationHindi = new ArrayList<>(Arrays.asList(
|
||||
'्', '़', 'ऽ', 'ः', '।', '॰', '॥' // Indic combining chars look the same, but have different Unicode values
|
||||
));
|
||||
|
||||
final private static ArrayList<Character> CombiningPunctuationHebrew = new ArrayList<>(Arrays.asList(
|
||||
',' , '-', '\'', ':', ';', '!', '?', '.', '"'
|
||||
|
|
@ -65,11 +68,16 @@ class Punctuation {
|
|||
public static boolean isCombiningPunctuation(Language language, char ch) {
|
||||
return
|
||||
CombiningPunctuation.contains(ch)
|
||||
|| (LanguageKind.isIndic(language) && CombiningPunctuationIndic.contains(ch))
|
||||
|| (LanguageKind.isGujarati(language) && CombiningPunctuationGujarati.contains(ch))
|
||||
|| (LanguageKind.isHindi(language) && CombiningPunctuationHindi.contains(ch))
|
||||
|| (LanguageKind.isHebrew(language) && CombiningPunctuationHebrew.contains(ch));
|
||||
}
|
||||
|
||||
public static boolean isCombiningPunctuation(char ch) {
|
||||
return CombiningPunctuation.contains(ch) || CombiningPunctuationIndic.contains(ch) || CombiningPunctuationHebrew.contains(ch);
|
||||
return
|
||||
CombiningPunctuation.contains(ch)
|
||||
|| CombiningPunctuationGujarati.contains(ch)
|
||||
|| CombiningPunctuationHindi.contains(ch)
|
||||
|| CombiningPunctuationHebrew.contains(ch);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue