diff options
Diffstat (limited to 'tools')
7 files changed, 111 insertions, 35 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 3d0557b5c..44f9695cf 100644 --- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java +++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/DictionaryMaker.java @@ -59,6 +59,9 @@ public class DictionaryMaker { private static final String OPTION_OUTPUT_XML = "-x"; private static final String OPTION_OUTPUT_COMBINED = "-o"; private static final String OPTION_HELP = "-h"; + private static final String OPTION_CODE_POINT_TABLE = "-t"; + private static final String OPTION_CODE_POINT_TABLE_OFF = "off"; + private static final String OPTION_CODE_POINT_TABLE_ON = "on"; public final String mInputBinary; public final String mInputCombined; public final String mInputUnigramXml; @@ -68,6 +71,7 @@ public class DictionaryMaker { public final String mOutputXml; public final String mOutputCombined; public final int mOutputBinaryFormatVersion; + public final int mCodePointTableMode; private void checkIntegrity() throws IOException { checkHasExactlyOneInput(); @@ -131,7 +135,7 @@ public class DictionaryMaker { + "[-s <unigrams.xml> [-b <bigrams.xml>] [-c <shortcuts_and_whitelist.xml>] " + "| [-s <combined format input]" + "| [-s <binary input>] [-d <binary output>] [-x <xml output>] " - + " [-o <combined output>]" + + " [-o <combined output>] [-t <code point table switch: on/off/auto>]" + "[-2] [-3] [-4]\n" + "\n" + " Converts a source dictionary file to one or several outputs.\n" @@ -155,6 +159,8 @@ public class DictionaryMaker { String outputXml = null; String outputCombined = null; int outputBinaryFormatVersion = 2; // the default version is 2. + // Don't use code point table by default. + int codePointTableMode = Ver2DictEncoder.CODE_POINT_TABLE_OFF; while (!args.isEmpty()) { final String arg = args.get(0); @@ -172,29 +178,38 @@ public class DictionaryMaker { throw new IllegalArgumentException("Option " + arg + " is unknown or " + "requires an argument"); } - String filename = args.get(0); + String argValue = args.get(0); args.remove(0); if (OPTION_INPUT_SOURCE.equals(arg)) { - if (XmlDictInputOutput.isXmlUnigramDictionary(filename)) { - inputUnigramXml = filename; - } else if (CombinedInputOutput.isCombinedDictionary(filename)) { - inputCombined = filename; - } else if (BinaryDictDecoderUtils.isBinaryDictionary(filename)) { - inputBinary = filename; + if (XmlDictInputOutput.isXmlUnigramDictionary(argValue)) { + inputUnigramXml = argValue; + } else if (CombinedInputOutput.isCombinedDictionary(argValue)) { + inputCombined = argValue; + } else if (BinaryDictDecoderUtils.isBinaryDictionary(argValue)) { + inputBinary = argValue; } else { throw new IllegalArgumentException( - "Unknown format for file " + filename); + "Unknown format for file " + argValue); } } else if (OPTION_INPUT_SHORTCUT_XML.equals(arg)) { - inputShortcutXml = filename; + inputShortcutXml = argValue; } else if (OPTION_INPUT_BIGRAM_XML.equals(arg)) { - inputBigramXml = filename; + inputBigramXml = argValue; } else if (OPTION_OUTPUT_BINARY.equals(arg)) { - outputBinary = filename; + outputBinary = argValue; } else if (OPTION_OUTPUT_XML.equals(arg)) { - outputXml = filename; + outputXml = argValue; } else if (OPTION_OUTPUT_COMBINED.equals(arg)) { - outputCombined = filename; + outputCombined = argValue; + } else if (OPTION_CODE_POINT_TABLE.equals(arg)) { + if (OPTION_CODE_POINT_TABLE_OFF.equals(argValue)) { + codePointTableMode = Ver2DictEncoder.CODE_POINT_TABLE_OFF; + } else if (OPTION_CODE_POINT_TABLE_ON.equals(argValue)) { + codePointTableMode = Ver2DictEncoder.CODE_POINT_TABLE_ON; + } else { + throw new IllegalArgumentException( + "Unknown argument to -t option : " + argValue); + } } else { throw new IllegalArgumentException("Unknown option : " + arg); } @@ -225,6 +240,7 @@ public class DictionaryMaker { mOutputXml = outputXml; mOutputCombined = outputCombined; mOutputBinaryFormatVersion = outputBinaryFormatVersion; + mCodePointTableMode = codePointTableMode; checkIntegrity(); } } @@ -335,7 +351,8 @@ public class DictionaryMaker { throws FileNotFoundException, IOException, UnsupportedFormatException, IllegalArgumentException { if (null != args.mOutputBinary) { - writeBinaryDictionary(args.mOutputBinary, dict, args.mOutputBinaryFormatVersion); + writeBinaryDictionary(args.mOutputBinary, dict, args.mOutputBinaryFormatVersion, + args.mCodePointTableMode); } if (null != args.mOutputXml) { writeXmlDictionary(args.mOutputXml, dict); @@ -351,19 +368,21 @@ public class DictionaryMaker { * @param outputFilename the name of the file to write to. * @param dict the dictionary to write. * @param version the binary format version to use. + * @param codePointTableMode the value to decide how we treat the code point table. * @throws FileNotFoundException if the output file can't be created. * @throws IOException if the output file can't be written to. */ private static void writeBinaryDictionary(final String outputFilename, - final FusionDictionary dict, final int version) + final FusionDictionary dict, final int version, final int codePointTableMode) throws FileNotFoundException, IOException, UnsupportedFormatException { final File outputFile = new File(outputFilename); final FormatSpec.FormatOptions formatOptions = new FormatSpec.FormatOptions(version); final DictEncoder dictEncoder; if (version == FormatSpec.VERSION4) { + // VERSION4 doesn't use the code point table. dictEncoder = new Ver4DictEncoder(outputFile); } else { - dictEncoder = new Ver2DictEncoder(outputFile); + dictEncoder = new Ver2DictEncoder(outputFile, codePointTableMode); } dictEncoder.writeDictionary(dict, formatOptions); } diff --git a/tools/make-keyboard-text/res/values-da/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-da/donottranslate-more-keys.xml index c22e26275..98abb0586 100644 --- a/tools/make-keyboard-text/res/values-da/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values-da/donottranslate-more-keys.xml @@ -18,26 +18,30 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <!-- U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE + <!-- U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE + U+00E6: "æ" LATIN SMALL LETTER AE + U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE U+0101: "ā" LATIN SMALL LETTER A WITH MACRON --> - <string name="morekeys_a">á,ä,à,â,ã,ā</string> + <string name="morekeys_a">å,æ,á,ä,à,â,ã,ā</string> <!-- U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS --> <string name="morekeys_e">é,ë</string> <!-- U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS --> <string name="morekeys_i">í,ï</string> - <!-- U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE + <!-- U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE + U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS + U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE U+0153: "œ" LATIN SMALL LIGATURE OE U+014D: "ō" LATIN SMALL LETTER O WITH MACRON --> - <string name="morekeys_o">ó,ô,ò,õ,œ,ō</string> + <string name="morekeys_o">ø,ö,ó,ô,ò,õ,œ,ō</string> <!-- U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX diff --git a/tools/make-keyboard-text/res/values-et-rEE/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-et-rEE/donottranslate-more-keys.xml index 9a8fa3c59..79266e823 100644 --- a/tools/make-keyboard-text/res/values-et-rEE/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values-et-rEE/donottranslate-more-keys.xml @@ -72,7 +72,6 @@ U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE --> <string name="morekeys_n">ņ,ñ,ń</string> - <!-- U+010D: "č" LATIN SMALL LETTER C WITH CARON U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE --> diff --git a/tools/make-keyboard-text/res/values-fi/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-fi/donottranslate-more-keys.xml index 82b847262..b06d9e49d 100644 --- a/tools/make-keyboard-text/res/values-fi/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values-fi/donottranslate-more-keys.xml @@ -18,21 +18,24 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <!-- U+00E6: "æ" LATIN SMALL LETTER AE + <!-- U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS + U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE + U+00E6: "æ" LATIN SMALL LETTER AE U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE U+0101: "ā" LATIN SMALL LETTER A WITH MACRON --> - <string name="morekeys_a">æ,à,á,â,ã,ā</string> - <!-- U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE + <string name="morekeys_a">ä,å,æ,à,á,â,ã,ā</string> + <!-- U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS + U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE U+0153: "œ" LATIN SMALL LIGATURE OE U+014D: "ō" LATIN SMALL LETTER O WITH MACRON --> - <string name="morekeys_o">ø,ô,ò,ó,õ,œ,ō</string> + <string name="morekeys_o">ö,ø,ô,ò,ó,õ,œ,ō</string> <!-- U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS --> <string name="morekeys_u">ü</string> <!-- U+0161: "š" LATIN SMALL LETTER S WITH CARON diff --git a/tools/make-keyboard-text/res/values-nb/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-nb/donottranslate-more-keys.xml index c5307a98d..37f9f8a1f 100644 --- a/tools/make-keyboard-text/res/values-nb/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values-nb/donottranslate-more-keys.xml @@ -18,13 +18,15 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <!-- U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE + <!-- U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE + U+00E6: "æ" LATIN SMALL LETTER AE U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS + U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE U+0101: "ā" LATIN SMALL LETTER A WITH MACRON --> - <string name="morekeys_a">à,ä,á,â,ã,ā</string> + <string name="morekeys_a">å,æ,ä,à,á,â,ã,ā</string> <!-- U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX @@ -33,14 +35,15 @@ U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE U+0113: "ē" LATIN SMALL LETTER E WITH MACRON --> <string name="morekeys_e">é,è,ê,ë,ę,ė,ē</string> - <!-- U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX + <!-- U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE + U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS + U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE - U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE U+0153: "œ" LATIN SMALL LIGATURE OE U+014D: "ō" LATIN SMALL LETTER O WITH MACRON --> - <string name="morekeys_o">ô,ò,ó,ö,õ,œ,ō</string> + <string name="morekeys_o">ø,ö,ô,ò,ó,õ,œ,ō</string> <!-- U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE diff --git a/tools/make-keyboard-text/res/values-sr-rZZ/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-sr-rZZ/donottranslate-more-keys.xml new file mode 100644 index 000000000..1168126ff --- /dev/null +++ b/tools/make-keyboard-text/res/values-sr-rZZ/donottranslate-more-keys.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE --> + <string name="morekeys_e">è</string> + <!-- U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE --> + <string name="morekeys_i">ì</string> + <!-- U+0161: "š" LATIN SMALL LETTER S WITH CARON --> + <string name="morekeys_s">š,%</string> + <!-- U+010D: "č" LATIN SMALL LETTER C WITH CARON + U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE --> + <string name="morekeys_c">č,ć,%</string> + <!-- U+0111: "đ" LATIN SMALL LETTER D WITH STROKE --> + <string name="morekeys_d">đ,%</string> + <!-- U+017E: "ž" LATIN SMALL LETTER Z WITH CARON --> + <string name="morekeys_z">ž,%</string> + <string name="label_go_key">"Idi"</string> + <string name="label_send_key">"Šalji"</string> + <string name="label_next_key">"Sled"</string> + <string name="label_done_key">"Gotov"</string> + <string name="label_search_key">"Traži"</string> + <string name="label_previous_key">"Preth"</string> + <string name="label_pause_key">"Pauza"</string> + <string name="label_wait_key">"Čekaj"</string> +</resources> diff --git a/tools/make-keyboard-text/res/values-sv/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-sv/donottranslate-more-keys.xml index ead514026..832e438f3 100644 --- a/tools/make-keyboard-text/res/values-sv/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values-sv/donottranslate-more-keys.xml @@ -18,12 +18,15 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <!-- U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE + <!-- U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS + U+00E5: "å" LATIN SMALL LETTER A WITH RING + U+00E6: "æ" LATIN SMALL LETTER AE + U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX U+0105: "ą" LATIN SMALL LETTER A WITH OGONEK U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE --> - <string name="morekeys_a">á,à,â,ą,ã</string> + <string name="morekeys_a">ä,å,æ,á,à,â,ą,ã</string> <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE U+010D: "č" LATIN SMALL LETTER C WITH CARON --> @@ -48,12 +51,15 @@ U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE U+0148: "ň" LATIN SMALL LETTER N WITH CARON --> <string name="morekeys_n">ń,ñ,ň</string> - <!-- U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE + <!-- U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS + U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE + U+0153: "œ" LATIN SMALL LIGATURE OE + U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE U+014D: "ō" LATIN SMALL LETTER O WITH MACRON --> - <string name="morekeys_o">ó,ò,ô,õ,ō</string> + <string name="morekeys_o">ö,ø,œ,ó,ò,ô,õ,ō</string> <!-- U+0159: "ř" LATIN SMALL LETTER R WITH CARON --> <string name="morekeys_r">ř</string> <!-- U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE |