From 1e0d7550d9cedac90c1c13413b9834f769d44f85 Mon Sep 17 00:00:00 2001 From: Ted Stein Date: Sun, 25 Feb 2018 22:51:14 -0800 Subject: [PATCH] Add ta marbutah to Arabic transliteration. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ة, a normally-silent form of the letter ت that was missed when this functionality was originally added. --- .../freeyourgadget/gadgetbridge/util/LanguageUtils.java | 2 +- .../gadgetbridge/test/LanguageUtilsTest.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/LanguageUtils.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/LanguageUtils.java index b93bc49b6..21246c436 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/LanguageUtils.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/LanguageUtils.java @@ -68,7 +68,7 @@ public class LanguageUtils { put('د', "d"); put('ذ', "th"); put('ر', "r"); put('ز', "z"); put('س', "s"); put('ش', "sh"); put('ص', "9"); put('ض', "9'"); put('ط', "6"); put('ظ', "6'"); put('ع', "3"); put('غ', "3'"); put('ف', "f"); put('ق', "q"); put('ك', "k"); put('ل', "l"); put('م', "m"); put('ن', "n"); put('ه', "h"); - put('و', "w"); put('ي', "y"); put('ى', "a"); + put('و', "w"); put('ي', "y"); put('ى', "a"); put('ﺓ', ""); put('آ', "2"); put('ئ', "2"); put('إ', "2"); put('ؤ', "2"); put('أ', "2"); put('ء', "2"); // Farsi diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/LanguageUtilsTest.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/LanguageUtilsTest.java index ccfd1ba38..5b09c026a 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/LanguageUtilsTest.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/LanguageUtilsTest.java @@ -39,7 +39,12 @@ 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("Arabic pangram transliteration failed", pangramExpected, pangramActual); + assertEquals("pangram transliteration failed", pangramExpected, pangramActual); + + String taMarbutah = "ﺓ"; + String taMarbutahExpected = ""; + String taMarbutahActual = LanguageUtils.transliterate(taMarbutah); + assertEquals("ta marbutah transliteration failed", taMarbutahExpected, taMarbutahActual); String hamza = "ءأؤإئآ"; String hamzaExpected = "222222";