diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java | 3 | ||||
-rw-r--r-- | tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java | 17 | ||||
-rw-r--r-- | tools/make-keyboard-text/res/values-az-rAZ/donottranslate-more-keys.xml (renamed from tools/make-keyboard-text/res/values-az/donottranslate-more-keys.xml) | 0 | ||||
-rw-r--r-- | tools/make-keyboard-text/res/values-ne-rNP/donottranslate-more-keys.xml (renamed from tools/make-keyboard-text/res/values-ne/donottranslate-more-keys.xml) | 0 |
4 files changed, 15 insertions, 5 deletions
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java index eb419fc28..143bce5ac 100644 --- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java +++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java @@ -46,7 +46,6 @@ public class DictionaryMaker { static class Arguments { private static final String OPTION_VERSION_2 = "-2"; - private static final String OPTION_VERSION_3 = "-3"; private static final String OPTION_VERSION_4 = "-4"; private static final String OPTION_INPUT_SOURCE = "-s"; private static final String OPTION_INPUT_BIGRAM_XML = "-b"; @@ -158,8 +157,6 @@ public class DictionaryMaker { if (arg.charAt(0) == '-') { if (OPTION_VERSION_2.equals(arg)) { // Do nothing, this is the default - } else if (OPTION_VERSION_3.equals(arg)) { - outputBinaryFormatVersion = FormatSpec.VERSION3; } else if (OPTION_VERSION_4.equals(arg)) { outputBinaryFormatVersion = FormatSpec.VERSION4; } else if (OPTION_HELP.equals(arg)) { diff --git a/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java b/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java index 9e397f19d..0c11f868e 100644 --- a/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java +++ b/tools/dicttool/tests/com/android/inputmethod/latin/dicttool/BinaryDictOffdeviceUtilsTests.java @@ -42,9 +42,16 @@ public class BinaryDictOffdeviceUtilsTests extends TestCase { private static final int TEST_FREQ = 37; // Some arbitrary value unlikely to happen by chance public void testGetRawDictWorks() throws IOException, UnsupportedFormatException { + final String VERSION = "1"; + final String LOCALE = "test"; + final String ID = "main:test"; + // Create a thrice-compressed dictionary file. - final FusionDictionary dict = new FusionDictionary(new PtNodeArray(), - new DictionaryOptions(new HashMap<String, String>())); + final DictionaryOptions testOptions = new DictionaryOptions(new HashMap<String, String>()); + testOptions.mAttributes.put(FormatSpec.FileHeader.DICTIONARY_VERSION_ATTRIBUTE, VERSION); + testOptions.mAttributes.put(FormatSpec.FileHeader.DICTIONARY_LOCALE_ATTRIBUTE, LOCALE); + testOptions.mAttributes.put(FormatSpec.FileHeader.DICTIONARY_ID_ATTRIBUTE, ID); + final FusionDictionary dict = new FusionDictionary(new PtNodeArray(), testOptions); dict.add("foo", TEST_FREQ, null, false /* isNotAWord */); dict.add("fta", 1, null, false /* isNotAWord */); dict.add("ftb", 1, null, false /* isNotAWord */); @@ -72,6 +79,12 @@ public class BinaryDictOffdeviceUtilsTests extends TestCase { final FusionDictionary resultDict = dictDecoder.readDictionaryBinary( null /* dict : an optional dictionary to add words to, or null */, false /* deleteDictIfBroken */); + assertEquals("Wrong version attribute", VERSION, resultDict.mOptions.mAttributes.get( + FormatSpec.FileHeader.DICTIONARY_VERSION_ATTRIBUTE)); + assertEquals("Wrong locale attribute", LOCALE, resultDict.mOptions.mAttributes.get( + FormatSpec.FileHeader.DICTIONARY_LOCALE_ATTRIBUTE)); + assertEquals("Wrong id attribute", ID, resultDict.mOptions.mAttributes.get( + FormatSpec.FileHeader.DICTIONARY_ID_ATTRIBUTE)); assertEquals("Dictionary can't be read back correctly", FusionDictionary.findWordInTree(resultDict.mRootNodeArray, "foo").getFrequency(), TEST_FREQ); diff --git a/tools/make-keyboard-text/res/values-az/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-az-rAZ/donottranslate-more-keys.xml index db1784c17..db1784c17 100644 --- a/tools/make-keyboard-text/res/values-az/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values-az-rAZ/donottranslate-more-keys.xml diff --git a/tools/make-keyboard-text/res/values-ne/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-ne-rNP/donottranslate-more-keys.xml index 9205e5309..9205e5309 100644 --- a/tools/make-keyboard-text/res/values-ne/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values-ne-rNP/donottranslate-more-keys.xml |