mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-24 16:21:16 +02:00
Add Arabic-style Eastern Arabic numerals to transliteration.
This commit is contained in:
parent
4e033c95da
commit
59a6e3633e
@ -77,12 +77,14 @@ public class LanguageUtils {
|
||||
put('ق', "q"); put('ك', "k"); put('ل', "l"); put('م', "m"); put('ن', "n"); put('ه', "h");
|
||||
put('و', "w"); put('ي', "y"); put('ى', "a"); put('ﺓ', "");
|
||||
put('آ', "2"); put('ئ', "2"); put('إ', "2"); put('ؤ', "2"); put('أ', "2"); put('ء', "2");
|
||||
put('٠', "0"); put('١', "1"); put('٢', "2"); put('٣', "3"); put('٤', "4"); put('٥', "5");
|
||||
put('٦', "6"); put('٧', "7"); put('٨', "8"); put('٩', "9");
|
||||
|
||||
// Persian(Farsi)
|
||||
put('پ', "p"); put('چ', "ch"); put('ژ', "zh"); put('ک', "k"); put('گ', "g"); put('ی', "y"); put('', " ");
|
||||
put('؟', "?"); put('٪', "%"); put('؛', ";"); put('،', ","); put('۱', "1"); put('۲', "2"); put('۳', "3");
|
||||
put('۴', "4"); put('۵', "5"); put('۶', "6"); put('۷', "7"); put('۸', "8"); put('۹', "9"); put('۰', "0");
|
||||
put('»', "<"); put('«', ">"); put('ِ', "e"); put('َ', "a"); put('ُ', "o"); put('ّ', "");
|
||||
put('»', "<"); put('«', ">"); put('ِ', "e"); put('َ', "a"); put('ُ', "o"); put('ّ', "");
|
||||
|
||||
// Polish
|
||||
put('Ł', "L"); put('ł', "l");
|
||||
|
@ -39,7 +39,7 @@ public class LanguageUtilsTest extends TestBase {
|
||||
String pangram = "نص حكيم له سر قاطع وذو شأن عظيم مكتوب على ثوب أخضر ومغلف بجلد أزرق";
|
||||
String pangramExpected = "n9 7kym lh sr qa63 wthw sh2n 36'ym mktwb 3la thwb 259'r wm3'lf bjld 2zrq";
|
||||
String pangramActual = LanguageUtils.transliterate(pangram);
|
||||
assertEquals("pangram transliteration failed", pangramExpected, pangramActual);
|
||||
assertEquals("Arabic pangram transliteration failed", pangramExpected, pangramActual);
|
||||
|
||||
String taMarbutah = "ﺓ";
|
||||
String taMarbutahExpected = "";
|
||||
@ -51,6 +51,14 @@ public class LanguageUtilsTest extends TestBase {
|
||||
String hamzaActual = LanguageUtils.transliterate(hamza);
|
||||
assertEquals("hamza transliteration failed", hamzaExpected, hamzaActual);
|
||||
|
||||
String easternArabicNumeralsArabic = "٠١٢٣٤٥٦٧٨٩";
|
||||
String easternArabicNumeralsFarsi = "۰۱۲۳۴۵۶۷۸۹";
|
||||
String easternArabicNumeralsExpected = "0123456789";
|
||||
assertEquals("Eastern Arabic numerals (Arabic) failed", easternArabicNumeralsExpected,
|
||||
LanguageUtils.transliterate(easternArabicNumeralsArabic));
|
||||
assertEquals("Eastern Arabic numerals (Farsi) failed", easternArabicNumeralsExpected,
|
||||
LanguageUtils.transliterate(easternArabicNumeralsFarsi));
|
||||
|
||||
String farsi = "گچپژ";
|
||||
String farsiExpected = "gchpzh";
|
||||
String farsiActual = LanguageUtils.transliterate(farsi);
|
||||
|
Loading…
Reference in New Issue
Block a user