From e1758feeffa388f2b75040e8f54b466c3591a148 Mon Sep 17 00:00:00 2001 From: Dan Zivkovic Date: Thu, 29 Jan 2015 10:17:33 -0800 Subject: [PATCH] Disable the Burmese keyboard. We'll resurrect this effort in the new code base. Bug 16900511. Change-Id: Iae4cd27cb29cb8f991e97cffd88ed59c30d66628 --- java/res/values/attrs.xml | 2 +- java/res/xml-sw600dp/rows_myanmar.xml | 58 ---- java/res/xml/kbd_myanmar.xml | 31 -- java/res/xml/keyboard_layout_set_myanmar.xml | 60 ---- java/res/xml/method.xml | 11 - java/res/xml/rowkeys_myanmar1.xml | 105 ------- java/res/xml/rowkeys_myanmar2.xml | 104 ------- java/res/xml/rowkeys_myanmar3.xml | 89 ------ java/res/xml/rowkeys_myanmar4.xml | 81 ------ java/res/xml/rows_myanmar.xml | 50 ---- .../inputmethod/event/CombinerChain.java | 40 +-- .../inputmethod/event/MyanmarReordering.java | 265 ----------------- .../keyboard/internal/KeyboardTextsTable.java | 36 --- .../inputmethod/latin/WordComposer.java | 3 +- .../inputmethod/keyboard/layout/Myanmar.java | 271 ------------------ .../KeyboardLayoutSetSubtypesCountTests.java | 2 +- .../keyboard/layout/tests/TestsMyanmarMM.java | 36 --- .../InputLogicTestsReorderingMyanmar.java | 235 --------------- 18 files changed, 4 insertions(+), 1475 deletions(-) delete mode 100644 java/res/xml-sw600dp/rows_myanmar.xml delete mode 100644 java/res/xml/kbd_myanmar.xml delete mode 100644 java/res/xml/keyboard_layout_set_myanmar.xml delete mode 100644 java/res/xml/rowkeys_myanmar1.xml delete mode 100644 java/res/xml/rowkeys_myanmar2.xml delete mode 100644 java/res/xml/rowkeys_myanmar3.xml delete mode 100644 java/res/xml/rowkeys_myanmar4.xml delete mode 100644 java/res/xml/rows_myanmar.xml delete mode 100644 java/src/com/android/inputmethod/event/MyanmarReordering.java delete mode 100644 tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java delete mode 100644 tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMyanmarMM.java delete mode 100644 tests/src/com/android/inputmethod/latin/InputLogicTestsReorderingMyanmar.java diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index bf36337a1..d9e42f1fe 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -556,7 +556,7 @@ - + diff --git a/java/res/xml-sw600dp/rows_myanmar.xml b/java/res/xml-sw600dp/rows_myanmar.xml deleted file mode 100644 index 20d9d8ab2..000000000 --- a/java/res/xml-sw600dp/rows_myanmar.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/res/xml/kbd_myanmar.xml b/java/res/xml/kbd_myanmar.xml deleted file mode 100644 index af997b1c8..000000000 --- a/java/res/xml/kbd_myanmar.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - diff --git a/java/res/xml/keyboard_layout_set_myanmar.xml b/java/res/xml/keyboard_layout_set_myanmar.xml deleted file mode 100644 index 5af8c064e..000000000 --- a/java/res/xml/keyboard_layout_set_myanmar.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index e14862206..33a10fa8f 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -75,7 +75,6 @@ mn_MN: Mongolian (Mongolia)/mongolian mr_IN: Marathi (India)/marathi ms_MY: Malay (Malaysia)/qwerty - my_MM: Myanmar (Myanmar)/myanmar # This is a preliminary keyboard layout. nb: Norwegian Bokmål/nordic ne_NP: Nepali (Nepal) Romanized/nepali_romanized ne_NP: Nepali (Nepal) Traditional/nepali_traditional @@ -545,16 +544,6 @@ android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,AsciiCapable,EmojiCapable" android:isAsciiCapable="true" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/res/xml/rowkeys_myanmar2.xml b/java/res/xml/rowkeys_myanmar2.xml deleted file mode 100644 index ae71ecbde..000000000 --- a/java/res/xml/rowkeys_myanmar2.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/res/xml/rowkeys_myanmar3.xml b/java/res/xml/rowkeys_myanmar3.xml deleted file mode 100644 index 4dafe09d7..000000000 --- a/java/res/xml/rowkeys_myanmar3.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/res/xml/rowkeys_myanmar4.xml b/java/res/xml/rowkeys_myanmar4.xml deleted file mode 100644 index a1befcfbb..000000000 --- a/java/res/xml/rowkeys_myanmar4.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/res/xml/rows_myanmar.xml b/java/res/xml/rows_myanmar.xml deleted file mode 100644 index 54538a9b9..000000000 --- a/java/res/xml/rows_myanmar.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/java/src/com/android/inputmethod/event/CombinerChain.java b/java/src/com/android/inputmethod/event/CombinerChain.java index 5858faa09..d77ece8e6 100644 --- a/java/src/com/android/inputmethod/event/CombinerChain.java +++ b/java/src/com/android/inputmethod/event/CombinerChain.java @@ -22,7 +22,6 @@ import android.text.TextUtils; import com.android.inputmethod.latin.common.Constants; import java.util.ArrayList; -import java.util.HashMap; import javax.annotation.Nonnull; @@ -45,13 +44,6 @@ public class CombinerChain { private SpannableStringBuilder mStateFeedback; private final ArrayList mCombiners; - private static final HashMap> IMPLEMENTED_COMBINERS = - new HashMap<>(); - static { - IMPLEMENTED_COMBINERS.put("MyanmarReordering", MyanmarReordering.class); - } - private static final String COMBINER_SPEC_SEPARATOR = ";"; - /** * Create an combiner chain. * @@ -61,15 +53,11 @@ public class CombinerChain { * cursor: we'll start after this. * * @param initialText The text that has already been combined so far. - * @param combinerList A list of combiners to be applied in order. */ - public CombinerChain(final String initialText, final Combiner... combinerList) { + public CombinerChain(final String initialText) { mCombiners = new ArrayList<>(); // The dead key combiner is always active, and always first mCombiners.add(new DeadKeyCombiner()); - for (final Combiner combiner : combinerList) { - mCombiners.add(combiner); - } mCombinedText = new StringBuilder(initialText); mStateFeedback = new SpannableStringBuilder(); } @@ -146,30 +134,4 @@ public class CombinerChain { final SpannableStringBuilder s = new SpannableStringBuilder(mCombinedText); return s.append(mStateFeedback); } - - public static Combiner[] createCombiners(final String spec) { - if (TextUtils.isEmpty(spec)) { - return new Combiner[0]; - } - final String[] combinerDescriptors = spec.split(COMBINER_SPEC_SEPARATOR); - final Combiner[] combiners = new Combiner[combinerDescriptors.length]; - int i = 0; - for (final String combinerDescriptor : combinerDescriptors) { - final Class combinerClass = - IMPLEMENTED_COMBINERS.get(combinerDescriptor); - if (null == combinerClass) { - throw new RuntimeException("Unknown combiner descriptor: " + combinerDescriptor); - } - try { - combiners[i++] = combinerClass.newInstance(); - } catch (InstantiationException e) { - throw new RuntimeException("Unable to instantiate combiner: " + combinerDescriptor, - e); - } catch (IllegalAccessException e) { - throw new RuntimeException("Unable to instantiate combiner: " + combinerDescriptor, - e); - } - } - return combiners; - } } diff --git a/java/src/com/android/inputmethod/event/MyanmarReordering.java b/java/src/com/android/inputmethod/event/MyanmarReordering.java deleted file mode 100644 index 7bc1630f5..000000000 --- a/java/src/com/android/inputmethod/event/MyanmarReordering.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.inputmethod.event; - -import com.android.inputmethod.latin.common.Constants; - -import java.util.ArrayList; -import java.util.Arrays; - -import javax.annotation.Nonnull; - -/** - * A combiner that reorders input for Myanmar. - */ -public class MyanmarReordering implements Combiner { - // U+1031 MYANMAR VOWEL SIGN E - private final static int VOWEL_E = 0x1031; // Code point for vowel E that we need to reorder - // U+200C ZERO WIDTH NON-JOINER - // U+200B ZERO WIDTH SPACE - private final static int ZERO_WIDTH_NON_JOINER = 0x200B; // should be 0x200C - - private final ArrayList mCurrentEvents = new ArrayList<>(); - - // List of consonants : - // U+1000 MYANMAR LETTER KA - // U+1001 MYANMAR LETTER KHA - // U+1002 MYANMAR LETTER GA - // U+1003 MYANMAR LETTER GHA - // U+1004 MYANMAR LETTER NGA - // U+1005 MYANMAR LETTER CA - // U+1006 MYANMAR LETTER CHA - // U+1007 MYANMAR LETTER JA - // U+1008 MYANMAR LETTER JHA - // U+1009 MYANMAR LETTER NYA - // U+100A MYANMAR LETTER NNYA - // U+100B MYANMAR LETTER TTA - // U+100C MYANMAR LETTER TTHA - // U+100D MYANMAR LETTER DDA - // U+100E MYANMAR LETTER DDHA - // U+100F MYANMAR LETTER NNA - // U+1010 MYANMAR LETTER TA - // U+1011 MYANMAR LETTER THA - // U+1012 MYANMAR LETTER DA - // U+1013 MYANMAR LETTER DHA - // U+1014 MYANMAR LETTER NA - // U+1015 MYANMAR LETTER PA - // U+1016 MYANMAR LETTER PHA - // U+1017 MYANMAR LETTER BA - // U+1018 MYANMAR LETTER BHA - // U+1019 MYANMAR LETTER MA - // U+101A MYANMAR LETTER YA - // U+101B MYANMAR LETTER RA - // U+101C MYANMAR LETTER LA - // U+101D MYANMAR LETTER WA - // U+101E MYANMAR LETTER SA - // U+101F MYANMAR LETTER HA - // U+1020 MYANMAR LETTER LLA - // U+103F MYANMAR LETTER GREAT SA - private static boolean isConsonant(final int codePoint) { - return (codePoint >= 0x1000 && codePoint <= 0x1020) || 0x103F == codePoint; - } - - // List of medials : - // U+103B MYANMAR CONSONANT SIGN MEDIAL YA - // U+103C MYANMAR CONSONANT SIGN MEDIAL RA - // U+103D MYANMAR CONSONANT SIGN MEDIAL WA - // U+103E MYANMAR CONSONANT SIGN MEDIAL HA - // U+105E MYANMAR CONSONANT SIGN MON MEDIAL NA - // U+105F MYANMAR CONSONANT SIGN MON MEDIAL MA - // U+1060 MYANMAR CONSONANT SIGN MON MEDIAL LA - // U+1082 MYANMAR CONSONANT SIGN SHAN MEDIAL WA - private static int[] MEDIAL_LIST = { 0x103B, 0x103C, 0x103D, 0x103E, - 0x105E, 0x105F, 0x1060, 0x1082}; - private static boolean isMedial(final int codePoint) { - return Arrays.binarySearch(MEDIAL_LIST, codePoint) >= 0; - } - - private static boolean isConsonantOrMedial(final int codePoint) { - return isConsonant(codePoint) || isMedial(codePoint); - } - - private Event getLastEvent() { - final int size = mCurrentEvents.size(); - if (size <= 0) { - return null; - } - return mCurrentEvents.get(size - 1); - } - - private CharSequence getCharSequence() { - final StringBuilder s = new StringBuilder(); - for (final Event e : mCurrentEvents) { - s.appendCodePoint(e.mCodePoint); - } - return s; - } - - /** - * Clears the currently combining stream of events and returns the resulting software text - * event corresponding to the stream. Optionally adds a new event to the cleared stream. - * @param newEvent the new event to add to the stream. null if none. - * @return the resulting software text event. Never null. - */ - @Nonnull - private Event clearAndGetResultingEvent(final Event newEvent) { - final CharSequence combinedText; - if (mCurrentEvents.size() > 0) { - combinedText = getCharSequence(); - mCurrentEvents.clear(); - } else { - combinedText = null; - } - if (null != newEvent) { - mCurrentEvents.add(newEvent); - } - return null == combinedText ? Event.createConsumedEvent(newEvent) - : Event.createSoftwareTextEvent(combinedText, Event.NOT_A_KEY_CODE); - } - - @Override - @Nonnull - public Event processEvent(ArrayList previousEvents, Event newEvent) { - final int codePoint = newEvent.mCodePoint; - if (VOWEL_E == codePoint) { - final Event lastEvent = getLastEvent(); - if (null == lastEvent) { - mCurrentEvents.add(newEvent); - return Event.createConsumedEvent(newEvent); - } - if (isConsonantOrMedial(lastEvent.mCodePoint)) { - final Event resultingEvent = clearAndGetResultingEvent(null); - mCurrentEvents.add(Event.createSoftwareKeypressEvent(ZERO_WIDTH_NON_JOINER, - Event.NOT_A_KEY_CODE, - Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE, - false /* isKeyRepeat */)); - mCurrentEvents.add(newEvent); - return resultingEvent; - } - // VOWEL_E == lastCodePoint. But if that was anything else this is correct too. - return clearAndGetResultingEvent(newEvent); - } - if (isConsonant(codePoint)) { - final Event lastEvent = getLastEvent(); - if (null == lastEvent) { - mCurrentEvents.add(newEvent); - return Event.createConsumedEvent(newEvent); - } - if (VOWEL_E == lastEvent.mCodePoint) { - final int eventSize = mCurrentEvents.size(); - if (eventSize >= 2 - && mCurrentEvents.get(eventSize - 2).mCodePoint == ZERO_WIDTH_NON_JOINER) { - // We have a ZWJN before a vowel E. We need to remove the ZWNJ and then - // reorder the vowel with respect to the consonant. - mCurrentEvents.remove(eventSize - 1); - mCurrentEvents.remove(eventSize - 2); - mCurrentEvents.add(newEvent); - mCurrentEvents.add(lastEvent); - return Event.createConsumedEvent(newEvent); - } - // If there is already a consonant, then we are starting a new syllable. - for (int i = eventSize - 2; i >= 0; --i) { - if (isConsonant(mCurrentEvents.get(i).mCodePoint)) { - return clearAndGetResultingEvent(newEvent); - } - } - // If we come here, we didn't have a consonant so we reorder - mCurrentEvents.remove(eventSize - 1); - mCurrentEvents.add(newEvent); - mCurrentEvents.add(lastEvent); - return Event.createConsumedEvent(newEvent); - } - // lastCodePoint is a consonant/medial. But if it's something else it's fine - return clearAndGetResultingEvent(newEvent); - } - if (isMedial(codePoint)) { - final Event lastEvent = getLastEvent(); - if (null == lastEvent) { - mCurrentEvents.add(newEvent); - return Event.createConsumedEvent(newEvent); - } - if (VOWEL_E == lastEvent.mCodePoint) { - final int eventSize = mCurrentEvents.size(); - // If there is already a consonant, then we are in the middle of a syllable, and we - // need to reorder. - boolean hasConsonant = false; - for (int i = eventSize - 2; i >= 0; --i) { - if (isConsonant(mCurrentEvents.get(i).mCodePoint)) { - hasConsonant = true; - break; - } - } - if (hasConsonant) { - mCurrentEvents.remove(eventSize - 1); - mCurrentEvents.add(newEvent); - mCurrentEvents.add(lastEvent); - return Event.createConsumedEvent(newEvent); - } - // Otherwise, we just commit everything. - return clearAndGetResultingEvent(null); - } - // lastCodePoint is a consonant/medial. But if it's something else it's fine - return clearAndGetResultingEvent(newEvent); - } - final Event lastEvent = getLastEvent(); - if (Constants.CODE_DELETE == newEvent.mKeyCode && null != lastEvent) { - final int eventSize = mCurrentEvents.size(); - if (VOWEL_E == lastEvent.mCodePoint) { - // We have a VOWEL_E at the end. There are four cases. - // - The vowel is the only code point in the buffer. Remove it. - // - The vowel is preceded by a ZWNJ. Remove both vowel E and ZWNJ. - // - The vowel is preceded by a consonant/medial, remove the consonant/medial. - // - In all other cases, it's strange, so just remove the last code point. - if (eventSize <= 1) { - mCurrentEvents.clear(); - } else { // eventSize >= 2 - final int previousCodePoint = mCurrentEvents.get(eventSize - 2).mCodePoint; - if (previousCodePoint == ZERO_WIDTH_NON_JOINER) { - mCurrentEvents.remove(eventSize - 1); - mCurrentEvents.remove(eventSize - 2); - } else if (isConsonantOrMedial(previousCodePoint)) { - mCurrentEvents.remove(eventSize - 2); - } else { - mCurrentEvents.remove(eventSize - 1); - } - } - return Event.createConsumedEvent(newEvent); - } else if (eventSize > 0) { - mCurrentEvents.remove(eventSize - 1); - return Event.createConsumedEvent(newEvent); - } - } - // This character is not part of the combining scheme, so we should reset everything. - if (mCurrentEvents.size() > 0) { - // If we have events in flight, then add the new event and return the resulting event. - mCurrentEvents.add(newEvent); - return clearAndGetResultingEvent(null); - } - // If we don't have any events in flight, then just pass this one through. - return newEvent; - } - - @Override - public CharSequence getCombiningStateFeedback() { - return getCharSequence(); - } - - @Override - public void reset() { - mCurrentEvents.clear(); - } -} diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java index a81d7ea2a..b50c0a86a 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java @@ -2781,41 +2781,6 @@ public final class KeyboardTextsTable { /* additional_morekeys_symbols_0 */ "0", }; - /* Locale my_MM: Burmese (Myanmar) */ - private static final String[] TEXTS_my_MM = { - /* morekeys_a ~ */ - null, null, null, null, - /* ~ morekeys_u */ - // Label for "switch to alphabetic" key. - // U+1000: "က" MYANMAR LETTER KA - // U+1001: "ခ" MYANMAR LETTER KHA - // U+1002: "ဂ" MYANMAR LETTER GA - /* keylabel_to_alpha */ "\u1000\u1001\u1002", - /* morekeys_i ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, - /* ~ morekeys_nordic_row2_11 */ - /* morekeys_punctuation */ "!autoColumnOrder!9,\u104A,.,?,!,#,),(,/,;,...,',@,:,-,\",+,\\%,&", - // U+104A: "၊" MYANMAR SIGN LITTLE SECTION - // U+104B: "။" MYANMAR SIGN SECTION - /* keyspec_tablet_comma */ "\u104A", - /* keyspec_period */ "\u104B", - /* morekeys_period */ null, - /* keyspec_tablet_period */ "\u104B", - /* keyspec_swiss_row1_11 ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, - /* ~ keyspec_comma */ - /* morekeys_tablet_comma */ "\\,", - /* keyhintlabel_period */ "\u104A", - /* morekeys_question ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, null, - /* ~ keyspec_south_slavic_row3_8 */ - /* morekeys_tablet_punctuation */ "!autoColumnOrder!8,.,',#,),(,/,;,@,...,:,-,\",+,\\%,&", - }; - /* Locale nb: Norwegian Bokmål */ private static final String[] TEXTS_nb = { // U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE @@ -4189,7 +4154,6 @@ public final class KeyboardTextsTable { "ml_IN" , TEXTS_ml_IN, /* 2/ 12 Malayalam (India) */ "mn_MN" , TEXTS_mn_MN, /* 2/ 12 Mongolian (Mongolia) */ "mr_IN" , TEXTS_mr_IN, /* 23/ 53 Marathi (India) */ - "my_MM" , TEXTS_my_MM, /* 8/ 98 Burmese (Myanmar) */ "nb" , TEXTS_nb, /* 11/ 55 Norwegian Bokmål */ "ne_NP" , TEXTS_ne_NP, /* 27/ 60 Nepali (Nepal) */ "nl" , TEXTS_nl, /* 9/ 13 Dutch */ diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index e605bfe78..e80e3628f 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -103,8 +103,7 @@ public final class WordComposer { final String nonNullCombiningSpec = null == combiningSpec ? "" : combiningSpec; if (!nonNullCombiningSpec.equals(mCombiningSpec)) { mCombinerChain = new CombinerChain( - mCombinerChain.getComposingWordWithCombiningFeedback().toString(), - CombinerChain.createCombiners(nonNullCombiningSpec)); + mCombinerChain.getComposingWordWithCombiningFeedback().toString()); mCombiningSpec = nonNullCombiningSpec; } } diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java b/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java deleted file mode 100644 index 026e70118..000000000 --- a/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.inputmethod.keyboard.layout; - -import com.android.inputmethod.keyboard.KeyboardId; -import com.android.inputmethod.keyboard.layout.customizer.LayoutCustomizer; -import com.android.inputmethod.keyboard.layout.expected.ExpectedKey; -import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder; -import com.android.inputmethod.latin.common.Constants; - -import java.util.Locale; - -/** - * The Myanmar alphabet keyboard. - */ -public final class Myanmar extends LayoutBase { - private static final String LAYOUT_NAME = "myanmar"; - - public Myanmar(final Locale locale) { - super(new MyanmarCustomizer(locale), Symbols.class, SymbolsShifted.class); - } - - @Override - public String getName() { return LAYOUT_NAME; } - - private static class MyanmarCustomizer extends LayoutCustomizer { - MyanmarCustomizer(final Locale locale) { super(locale); } - - @Override - public int getNumberOfRows() { return 5; } - - @Override - public ExpectedKey getAlphabetKey() { return MYANMAR_ALPHABET_KEY; } - - @Override - public ExpectedKey[] getRightShiftKeys(final boolean isPhone) { - return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS; - } - - @Override - public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) { - // U+002C: "," COMMA - // U+104A: "၊" MYANMAR SIGN LITTLE SECTION - return isPhone ? joinKeys(key("\u002C", SETTINGS_KEY)) - : joinKeys(key("\u104A", moreKey(","), SETTINGS_KEY)); - } - - @Override - public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) { - // U+104B: "။" MYANMAR SIGN SECTION - final ExpectedKey periodKey = key("\u104B", getPunctuationMoreKeys(isPhone)); - return joinKeys(periodKey); - } - - @Override - public ExpectedKey[] getPunctuationMoreKeys(final boolean isPhone) { - return isPhone ? MYANMAR_PHONE_PUNCTUATION_MORE_KEYS - : MYANMAR_TABLET_PUNCTUATION_MORE_KEYS; - } - - // U+1000: "က" MYANMAR LETTER KA - // U+1001: "ခ" MYANMAR LETTER KHA - // U+1002: "ဂ" MYANMAR LETTER GA - private static final ExpectedKey MYANMAR_ALPHABET_KEY = key( - "\u1000\u1001\u1002", Constants.CODE_SWITCH_ALPHA_SYMBOL); - - // U+104A: "၊" MYANMAR SIGN LITTLE SECTION - // Punctuation more keys for phone form factor. - private static final ExpectedKey[] MYANMAR_PHONE_PUNCTUATION_MORE_KEYS = joinKeys( - "\u104A", ".", "?", "!", "#", ")", "(", "/", ";", - "...", "'", "@", ":", "-", "\"", "+", "%", "&"); - // Punctuation more keys for tablet form factor. - private static final ExpectedKey[] MYANMAR_TABLET_PUNCTUATION_MORE_KEYS = joinKeys( - ".", "'", "#", ")", "(", "/", ";", "@", - "...", ":", "-", "\"", "+", "%", "&"); - } - - @Override - ExpectedKey[][] getCommonAlphabetLayout(final boolean isPhone) { return ALPHABET_COMMON; } - - @Override - public ExpectedKey[][] getCommonAlphabetShiftLayout(final boolean isPhone, - final int elementId) { - if (elementId == KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED) { - return getCommonAlphabetLayout(isPhone); - } - return ALPHABET_SHIFTED_COMMON; - } - - private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder() - .setKeysOfRow(1, - // U+1041: "၁" MYANMAR DIGIT ONE - key("\u1041", moreKey("1")), - // U+1042: "၂" MYANMAR DIGIT TWO - key("\u1042", moreKey("2")), - // U+1043: "၃" MYANMAR DIGIT THREE - key("\u1043", moreKey("3")), - // U+1044: "၄" MYANMAR DIGIT FOUR - key("\u1044", moreKey("4")), - // U+1045: "၅" MYANMAR DIGIT FIVE - key("\u1045", moreKey("5")), - // U+1046: "၆" MYANMAR DIGIT SIX - key("\u1046", moreKey("6")), - // U+1047: "၇" MYANMAR DIGIT SEVEN - key("\u1047", moreKey("7")), - // U+1048: "၈" MYANMAR DIGIT EIGHT - key("\u1048", moreKey("8")), - // U+1049: "၉" MYANMAR DIGIT NINE - key("\u1049", moreKey("9")), - // U+1040: "၀" MYANMAR DIGIT ZERO - key("\u1040", moreKey("0"))) - .setKeysOfRow(2, - // U+1006: "ဆ" MYANMAR LETTER CHA - // U+1039/U+1006: "္ဆ" MYANMAR SIGN VIRAMA/MYANMAR LETTER CHA - key("\u1006", moreKey("\u1039\u1006")), - // U+1010: "တ" MYANMAR LETTER TA - // U+1039/U+1010: "္တ" MYANMAR SIGN VIRAMA/MYANMAR LETTER TA - key("\u1010", moreKey("\u1039\u1010")), - // U+1014: "န" MYANMAR LETTER NA - // U+1039/U+1014: "္န" MYANMAR SIGN VIRAMA/MYANMAR LETTER NA - key("\u1014", moreKey("\u1039\u1014")), - // U+1019: "မ" MYANMAR LETTER MA - // U+1039/U+1019: "္မ" MYANMAR SIGN VIRAMA/MYANMAR LETTER MA - key("\u1019", moreKey("\u1039\u1019")), - // U+1021: "အ" MYANMAR LETTER A - // U+1015: "ပ" MYANMAR LETTER PA - "\u1021", "\u1015", - // U+1000: "က" MYANMAR LETTER KA - // U+1039/U+1000: "္က" MYANMAR SIGN VIRAMA/MYANMAR LETTER KA - key("\u1000", moreKey("\u1039\u1000")), - // U+1004: "င" MYANMAR LETTER NGA - // U+101E: "သ" MYANMAR LETTER SA - "\u1004", "\u101E", - // U+1005: "စ" MYANMAR LETTER CA - // U+1039/U+1005: "္စ" MYANMAR SIGN VIRAMA/MYANMAR LETTER CA - key("\u1005", moreKey("\u1039\u1005"))) - .setKeysOfRow(3, - // U+1031: "ေ" MYANMAR VOWEL SIGN E - // U+103B: "ျ" MYANMAR CONSONANT SIGN MEDIAL YA - // U+103C: "ြ" MYANMAR CONSONANT SIGN MEDIAL RA - "\u1031", "\u103B", "\u103C", - // U+103D: "ွ" MYANMAR CONSONANT SIGN MEDIAL WA - // U+103E: "ှ" MYANMAR CONSONANT SIGN MEDIAL HA - // U+103D/U+103E: - // "ွှ" MYANMAR CONSONANT SIGN MEDIAL WA/MYANMAR CONSONANT SIGN MEDIAL HA - key("\u103D", joinMoreKeys("\u103E", "\u103D\u103E")), - // U+102D: "ိ" MYANMAR VOWEL SIGN I - // U+102E: "ီ" MYANMAR VOWEL SIGN II - key("\u102D", moreKey("\u102E")), - // U+102F: "ု" MYANMAR VOWEL SIGN U - // U+1030: "ူ" MYANMAR VOWEL SIGN UU - key("\u102F", moreKey("\u1030")), - // U+102C: "ာ" MYANMAR VOWEL SIGN AA - // U+102B: "ါ" MYANMAR VOWEL SIGN TALL AA - key("\u102C", moreKey("\u102B")), - // U+103A: "်" MYANMAR SIGN ASAT - // U+1032: "ဲ" MYANMAR VOWEL SIGN AI - key("\u103A", moreKey("\u1032")), - // U+1037: "့" MYANMAR SIGN DOT BELOW - // U+1036: "ံ" MYANMAR SIGN ANUSVARA - key("\u1037", moreKey("\u1036")), - // U+1038: "း" MYANMAR SIGN VISARGA - "\u1038") - .setKeysOfRow(4, - // U+1016: "ဖ" MYANMAR LETTER PHA - "\u1016", - // U+1011: "ထ" MYANMAR LETTER THA - // U+1039/U+1011: "္ထ" MYANMAR SIGN VIRAMA/MYANMAR LETTER THA - key("\u1011", moreKey("\u1039\u1011")), - // U+1001: "ခ" MYANMAR LETTER KHA - // U+1039/U+1001: "္ခ" MYANMAR SIGN VIRAMA/MYANMAR LETTER KHA - key("\u1001", moreKey("\u1039\u1001")), - // U+101C: "လ" MYANMAR LETTER LA - // U+1039/U+101C: "္လ" MYANMAR SIGN VIRAMA/MYANMAR LETTER LA - key("\u101C", moreKey("\u1039\u101C")), - // U+1018: "ဘ" MYANMAR LETTER BHA - // U+1039/U+1018: "္ဘ" MYANMAR SIGN VIRAMA/MYANMAR LETTER BHA - key("\u1018", moreKey("\u1039\u1018")), - // U+100A: "ည" MYANMAR LETTER NNYA - // U+1009: "ဉ" MYANMAR LETTER NYA - key("\u100A", moreKey("\u1009")), - // U+101B: "ရ" MYANMAR LETTER RA - // U+101D: "ဝ" MYANMAR LETTER WA - "\u101B", "\u101D") - .build(); - - private static final ExpectedKey[][] ALPHABET_SHIFTED_COMMON = new ExpectedKeyboardBuilder() - .setKeysOfRow(1, - // U+1027: "ဧ" MYANMAR LETTER E - // U+104F: "၏" MYANMAR SYMBOL GENITIVE - // U+1024: "ဤ" MYANMAR LETTER II - // U+1023: "ဣ" MYANMAR LETTER I - // U+104E: "၎" MYANMAR SYMBOL AFOREMENTIONED - // U+1000/U+103B/U+1015/U+103A: "ကျပ်" MYANMAR LETTER KA - // /MYANMAR CONSONANT SIGN MEDIAL YA/MYANMAR LETTER PA/MYANMAR SIGN ASAT - // U+1029: "ဩ" MYANMAR LETTER O - // U+102A: "ဪ" MYANMAR LETTER AU - // U+104D: "၍" MYANMAR SYMBOL COMPLETED - // U+104C: "၌" MYANMAR SYMBOL LOCATIVE - "\u1027", "\u104F", "\u1024", "\u1023", "\u104E", "\u1000\u103B\u1015\u103A", - "\u1029", "\u102A", "\u104D", "\u104C") - .setKeysOfRow(2, - // U+1017: "ဗ" MYANMAR LETTER BA - // U+1039/U+1017: "္ဗ" MYANMAR SIGN VIRAMA/MYANMAR LETTER BA - key("\u1017", moreKey("\u1039\u1017")), - // U+1012: "ဒ" MYANMAR LETTER DA - // U+1039/U+1012: "္ဒ" MYANMAR SIGN VIRAMA/MYANMAR LETTER DA - key("\u1012", moreKey("\u1039\u1012")), - // U+1013: "ဓ" MYANMAR LETTER DHA - // U+1039/U+1013: "္ဓ" MYANMAR SIGN VIRAMA/MYANMAR LETTER DHA - key("\u1013", moreKey("\u1039\u1013")), - // U+1003: "ဃ" MYANMAR LETTER GHA - // U+100E: "ဎ" MYANMAR LETTER DDHA - // U+103F: "ဿ" MYANMAR LETTER GREAT SA - // U+100F: "ဏ" MYANMAR LETTER NNA - "\u1003", "\u100E", "\u103F", "\u100F", - // U+1008: "ဈ" MYANMAR LETTER JHA - // U+1039/U+1008: "္ဈ" MYANMAR SIGN VIRAMA/MYANMAR LETTER JHA - key("\u1008", moreKey("\u1039\u1008")), - // U+1007: "ဇ" MYANMAR LETTER JA - // U+1039/U+1007: "္ဇ" MYANMAR SIGN VIRAMA/MYANMAR LETTER JA - key("\u1007", moreKey("\u1039\u1007")), - // U+1002: "ဂ" MYANMAR LETTER GA - // U+1039/U+1002: "္ဂ" MYANMAR SIGN VIRAMA/MYANMAR LETTER GA - key("\u1002", moreKey("\u1039\u1002"))) - .setKeysOfRow(3, - // U+101A: "ယ" MYANMAR LETTER YA - // U+1039: "္" MYANMAR SIGN VIRAMA - // U+1004/U+103A/U+1039: "င်္င" MYANMAR LETTER NGA - // /MYANMAR SIGN ASAT/MYANMAR SIGN VIRAMA - // U+103E: "ှ" MYANMAR CONSONANT SIGN MEDIAL HA - // U+102E: "ီ" MYANMAR VOWEL SIGN II - // U+1030: "ူ" MYANMAR VOWEL SIGN UU - // U+102B: "ါ" MYANMAR VOWEL SIGN TALL AA - // U+1032: "ဲ" MYANMAR VOWEL SIGN AI - // U+1036: "ံ" MYANMAR SIGN ANUSVARA - // U+101F: "ဟ" MYANMAR LETTER HA - "\u101A", "\u1039", "\u1004\u103A\u1039", "\u103E", "\u102E", "\u1030", - "\u102B", "\u1032", "\u1036", "\u101F") - .setKeysOfRow(4, - // U+1025: "ဥ" MYANMAR LETTER U - // U+1026: "ဦ" MYANMAR LETTER UU - // U+100C: "ဌ" MYANMAR LETTER TTHA - // U+100B: "ဋ" MYANMAR LETTER TTA - // U+100D: "ဍ" MYANMAR LETTER DDA - // U+1020: "ဠ" MYANMAR LETTER LLA - // U+100B/U+1039/U+100C: "ဋ္ဌ" MYANMAR LETTER TTA - // /MYANMAR SIGN VIRAMA/MYANMAR LETTER TTHA - "\u1025", "\u1026", "\u100C", "\u100B", "\u100D", "\u1020", - "\u100B\u1039\u100C", - // U+100F/U+1039/U+100D: "ဏ္ဍ" MYANMAR LETTER NNA - // /MYANMAR SIGN VIRAMA/MYANMAR LETTER DDA - // U+100F/U+1039/U+100C: "ဏ္ဌ" MYANMAR LETTER NNA - // /MYANMAR SIGN VIRAMA/MYANMAR LETTER TTHA - key("\u100F\u1039\u100D", moreKey("\u100F\u1039\u100C"))) - .build(); -} diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/KeyboardLayoutSetSubtypesCountTests.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/KeyboardLayoutSetSubtypesCountTests.java index 6f747b377..3e351b643 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/tests/KeyboardLayoutSetSubtypesCountTests.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/KeyboardLayoutSetSubtypesCountTests.java @@ -27,7 +27,7 @@ import java.util.ArrayList; @SmallTest public class KeyboardLayoutSetSubtypesCountTests extends KeyboardLayoutSetTestsBase { - private static final int NUMBER_OF_SUBTYPES = 85; + private static final int NUMBER_OF_SUBTYPES = 84; private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 50; private static final int NUMBER_OF_PREDEFINED_ADDITIONAL_SUBTYPES = 2; diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMyanmarMM.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMyanmarMM.java deleted file mode 100644 index b581e4a12..000000000 --- a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMyanmarMM.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.inputmethod.keyboard.layout.tests; - -import android.test.suitebuilder.annotation.SmallTest; - -import com.android.inputmethod.keyboard.layout.LayoutBase; -import com.android.inputmethod.keyboard.layout.Myanmar; - -import java.util.Locale; - -/** - * my_MM: Myanmar (Myanmar)/myanmar - */ -@SmallTest -public final class TestsMyanmarMM extends LayoutTestsBase { - private static final Locale LOCALE = new Locale("my", "MM"); - private static final LayoutBase LAYOUT = new Myanmar(LOCALE); - - @Override - LayoutBase getLayout() { return LAYOUT; } -} diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTestsReorderingMyanmar.java b/tests/src/com/android/inputmethod/latin/InputLogicTestsReorderingMyanmar.java deleted file mode 100644 index 1372514da..000000000 --- a/tests/src/com/android/inputmethod/latin/InputLogicTestsReorderingMyanmar.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.inputmethod.latin; - -import android.test.suitebuilder.annotation.LargeTest; -import android.test.suitebuilder.annotation.Suppress; -import android.util.Pair; - -/* - * Relevant characters for this test : - * Spurs the need to reorder : - * U+1031 MYANMAR VOWEL SIGN E : ေ - * U+1004 U+103A U+1039 Kinzi. It's a compound character. - * - * List of consonants : - * U+1000 MYANMAR LETTER KA က - * U+1001 MYANMAR LETTER KHA ခ - * U+1002 MYANMAR LETTER GA ဂ - * U+1003 MYANMAR LETTER GHA ဃ - * U+1004 MYANMAR LETTER NGA င - * U+1005 MYANMAR LETTER CA စ - * U+1006 MYANMAR LETTER CHA ဆ - * U+1007 MYANMAR LETTER JA ဇ - * U+1008 MYANMAR LETTER JHA ဈ - * U+1009 MYANMAR LETTER NYA ဉ - * U+100A MYANMAR LETTER NNYA ည - * U+100B MYANMAR LETTER TTA ဋ - * U+100C MYANMAR LETTER TTHA ဌ - * U+100D MYANMAR LETTER DDA ဍ - * U+100E MYANMAR LETTER DDHA ဎ - * U+100F MYANMAR LETTER NNA ဏ - * U+1010 MYANMAR LETTER TA တ - * U+1011 MYANMAR LETTER THA ထ - * U+1012 MYANMAR LETTER DA ဒ - * U+1013 MYANMAR LETTER DHA ဓ - * U+1014 MYANMAR LETTER NA န - * U+1015 MYANMAR LETTER PA ပ - * U+1016 MYANMAR LETTER PHA ဖ - * U+1017 MYANMAR LETTER BA ဗ - * U+1018 MYANMAR LETTER BHA ဘ - * U+1019 MYANMAR LETTER MA မ - * U+101A MYANMAR LETTER YA ယ - * U+101B MYANMAR LETTER RA ရ - * U+101C MYANMAR LETTER LA လ - * U+101D MYANMAR LETTER WA ဝ - * U+101E MYANMAR LETTER SA သ - * U+101F MYANMAR LETTER HA ဟ - * U+1020 MYANMAR LETTER LLA ဠ - * U+103F MYANMAR LETTER GREAT SA ဿ - * - * List of medials : - * U+103B MYANMAR CONSONANT SIGN MEDIAL YA ျ - * U+103C MYANMAR CONSONANT SIGN MEDIAL RA ြ - * U+103D MYANMAR CONSONANT SIGN MEDIAL WA ွ - * U+103E MYANMAR CONSONANT SIGN MEDIAL HA ှ - * U+105E MYANMAR CONSONANT SIGN MON MEDIAL NA ၞ - * U+105F MYANMAR CONSONANT SIGN MON MEDIAL MA ၟ - * U+1060 MYANMAR CONSONANT SIGN MON MEDIAL LA ၠ - * U+1082 MYANMAR CONSONANT SIGN SHAN MEDIAL WA ႂ - * - * Other relevant characters : - * U+200C ZERO WIDTH NON-JOINER - * U+200B ZERO WIDTH SPACE - */ - -@LargeTest -// These tests are inactive until the combining code for Myanmar Reordering is sorted out. -@Suppress -public class InputLogicTestsReorderingMyanmar extends InputTestsBase { - // The tests are formatted as follows. - // Each test is an entry in the array of Pair arrays. - - // One test is an array of pairs. Each pair contains, in the `first' member, - // the code points that the next key press should contain. In the `second' - // member is stored the string that should be in the text view after this - // key press. - - private static final Pair[][] TESTS = { - - // Tests for U+1031 MYANMAR VOWEL SIGN E : ေ - new Pair[] { // Type : U+1031 U+1000 U+101F ေ က ဟ - Pair.create(new int[] { 0x1031 }, "\u1031"), // ေ - Pair.create(new int[] { 0x1000 }, "\u1000\u1031"), // ကေ - Pair.create(new int[] { 0x101F }, "\u1000\u1031\u101F") // ကေဟ - }, - - new Pair[] { // Type : U+1000 U+1031 U+101F က ေ ဟ - Pair.create(new int[] { 0x1000 }, "\u1000"), // က - Pair.create(new int[] { 0x1031 }, "\u1000\u200B\u1031"), // က‌ေ - Pair.create(new int[] { 0x101F }, "\u1000\u101F\u1031") // ကဟေ - }, - - new Pair[] { // Type : U+1031 U+101D U+103E U+1018 ေ ဝ ှ ဘ - Pair.create(new int[] { 0x1031 }, "\u1031"), // ေ - Pair.create(new int[] { 0x101D }, "\u101D\u1031"), // ဝေ - Pair.create(new int[] { 0x103E }, "\u101D\u103E\u1031"), // ဝှေ - Pair.create(new int[] { 0x1018 }, "\u101D\u103E\u1031\u1018") // ဝှေဘ - }, - - new Pair[] { // Type : U+1031 U+1014 U+1031 U+1000 U+102C U+1004 U+103A U+1038 U+101C - // U+102C U+1038 U+104B ေ န ေ က ာ င ် း လ ာ း ။ - Pair.create(new int[] { 0x1031 }, "\u1031"), // ေ - Pair.create(new int[] { 0x1014 }, "\u1014\u1031"), // နေ - Pair.create(new int[] { 0x1031 }, "\u1014\u1031\u1031"), // နေ‌ေ - Pair.create(new int[] { 0x1000 }, "\u1014\u1031\u1000\u1031"), // နေကေ - Pair.create(new int[] { 0x102C }, "\u1014\u1031\u1000\u1031\u102C"), // နေကော - Pair.create(new int[] { 0x1004 }, "\u1014\u1031\u1000\u1031\u102C\u1004"), // နေကောင - Pair.create(new int[] { 0x103A }, // နေကောင် - "\u1014\u1031\u1000\u1031\u102C\u1004\u103A"), - Pair.create(new int[] { 0x1038 }, // နေကောင်း - "\u1014\u1031\u1000\u1031\u102C\u1004\u103A\u1038"), - Pair.create(new int[] { 0x101C }, // နေကောင်းလ - "\u1014\u1031\u1000\u1031\u102C\u1004\u103A\u1038\u101C"), - Pair.create(new int[] { 0x102C }, // နေကောင်းလာ - "\u1014\u1031\u1000\u1031\u102C\u1004\u103A\u1038\u101C\u102C"), - Pair.create(new int[] { 0x1038 }, // နေကောင်းလား - "\u1014\u1031\u1000\u1031\u102C\u1004\u103A\u1038\u101C\u102C\u1038"), - Pair.create(new int[] { 0x104B }, // နေကောင်းလား။ - "\u1014\u1031\u1000\u1031\u102C\u1004\u103A\u1038\u101C\u102C\u1038\u104B") - }, - - new Pair[] { // Type : U+1031 U+1031 U+1031 U+1000 ေ ေ ေ က - Pair.create(new int[] { 0x1031 }, "\u1031"), // ေ - Pair.create(new int[] { 0x1031 }, "\u1031\u1031"), // ေေ - Pair.create(new int[] { 0x1031 }, "\u1031\u1031\u1031"), // U+1031ေေေ - Pair.create(new int[] { 0x1000 }, "\u1031\u1031\u1000\u1031") // ေေကေ - }, - - new Pair[] { // Type : U+1031 U+1001 U+103B U+103D U+1038 ေ ခ ျ ွ း - Pair.create(new int[] { 0x1031 }, "\u1031"), // ေ - Pair.create(new int[] { 0x1001 }, "\u1001\u1031"), // ခေ - Pair.create(new int[] { 0x103B }, "\u1001\u103B\u1031"), // ချေ - Pair.create(new int[] { 0x103D }, "\u1001\u103B\u103D\u1031"), // ချွေ - Pair.create(new int[] { 0x1038 }, "\u1001\u103B\u103D\u1031\u1038") // ချွေး - }, - - // Tests for Kinzi U+1004 U+103A U+1039 : - - /* Kinzi reordering is not implemented yet. Uncomment these tests when it is. - - new Pair[] { // Type : U+1021 U+1002 (U+1004 U+103A U+1039) - // U+101C U+1014 U+103A အ ဂ (င ် ္) လ န ် - Pair.create(new int[] { 0x1021 }, "\u1021"), // အ - Pair.create(new int[] { 0x1002 }, "\u1021\u1002"), // အဂ - Pair.create(new int[] { 0x1004, 0x103A, 0x1039 }, // အင်္ဂ - "\u1021\u1004\u103A\u1039\u1002"), - Pair.create(new int[] { 0x101C }, // အင်္ဂလ - "\u1021\u1004\u103A\u1039\u1002\u101C"), - Pair.create(new int[] { 0x1014 }, // အင်္ဂလန - "\u1021\u1004\u103A\u1039\u1002\u101C\u1014"), - Pair.create(new int[] { 0x103A }, // အင်္ဂလန် - "\u1021\u1004\u103A\u1039\u1002\u101C\u1014\u103A") - }, - - new Pair[] { //Type : kinzi after a whole syllable U+101E U+1001 U+103B U+102D U+102F - // (U+1004 U+103A U+1039) U+1004 U+103A U+1038 သ ခ ျ ိ ု င ် ္ င ် း - Pair.create(new int[] { 0x101E }, "\u101E"), // သခ - Pair.create(new int[] { 0x1001 }, "\u101E\u1001"), // သခ - Pair.create(new int[] { 0x103B }, "\u101E\u1001\u103B"), // သချ - Pair.create(new int[] { 0x102D }, "\u101E\u1001\u103B\u102D"), // သချိ - Pair.create(new int[] { 0x102F }, "\u101E\u1001\u103B\u102D\u102F"), // သချို - Pair.create(new int[] { 0x1004, 0x103A, 0x1039}, // သင်္ချို - "\u101E\u1004\u103A\u1039\u1001\u103B\u102D\u102F"), - Pair.create(new int[] { 0x1004 }, // သင်္ချိုင - "\u101E\u1004\u103A\u1039\u1001\u103B\u102D\u102F\u1004"), - Pair.create(new int[] { 0x103A }, // သင်္ချိုင် - "\u101E\u1004\u103A\u1039\u1001\u103B\u102D\u102F\u1004\u103A"), - Pair.create(new int[] { 0x1038 }, // သင်္ချိုင်း - "\u101E\u1004\u103A\u1039\u1001\u103B\u102D\u102F\u1004\u103A\u1038") - }, - - new Pair[] { // Type : kinzi after the consonant U+101E U+1001 (U+1004 U+103A U+1039) - // U+103B U+102D U+102F U+1004 U+103A U+1038 သ ခ င ် ္ ျ ိ ု င ် း - Pair.create(new int[] { 0x101E }, "\u101E"), // သခ - Pair.create(new int[] { 0x1001 }, "\u101E\u1001"), // သခ - Pair.create(new int[] { 0x1004, 0x103A, 0x1039 }, // သင်္ခ - "\u101E\u1004\u103A\u1039\u1001"), - Pair.create(new int[] { 0x103B }, // သင်္ချ - "\u101E\u1004\u103A\u1039\u1001\u103B"), - Pair.create(new int[] { 0x102D }, // သင်္ချိ - "\u101E\u1004\u103A\u1039\u1001\u103B\u102D"), - Pair.create(new int[] { 0x102F }, // သင်္ချို - "\u101E\u1004\u103A\u1039\u1001\u103B\u102D\u102F"), - Pair.create(new int[] { 0x1004 }, // သင်္ချိုင - "\u101E\u1004\u103A\u1039\u1001\u103B\u102D\u102F\u1004"), - Pair.create(new int[] { 0x103A }, // သင်္ချိုင် - "\u101E\u1004\u103A\u1039\u1001\u103B\u102D\u102F\u1004\u103A"), - Pair.create(new int[] { 0x1038 }, // သင်္ချိုင်း - "\u101E\u1004\u103A\u1039\u1001\u103B\u102D\u102F\u1004\u103A\u1038") - }, - */ - }; - - private void doMyanmarTest(final int testNumber, final Pair[] test) { - int stepNumber = 0; - for (final Pair step : test) { - ++stepNumber; - final int[] input = (int[]) step.first; - final String expectedResult = (String) step.second; - if (input.length > 1) { - mLatinIME.onTextInput(new String(input, 0, input.length)); - } else { - type(input[0]); - } - assertEquals("Myanmar reordering test " + testNumber + ", step " + stepNumber, - expectedResult, mEditText.getText().toString()); - } - } - - public void testMyanmarReordering() { - int testNumber = 0; - changeLanguage("my_MM", "CombiningRules=MyanmarReordering"); - for (final Pair[] test : TESTS) { - // Small trick to reset LatinIME : setText("") and send updateSelection with values - // LatinIME has never seen, and cursor pos 0,0. - mEditText.setText(""); - mLatinIME.onUpdateSelection(1, 1, 0, 0, -1, -1); - doMyanmarTest(++testNumber, test); - } - } -}