diff options
Diffstat (limited to 'tools')
33 files changed, 951 insertions, 99 deletions
diff --git a/tools/makedict/Android.mk b/tools/dicttool/Android.mk index 7b5dee2ce..5bd836a01 100644 --- a/tools/makedict/Android.mk +++ b/tools/dicttool/Android.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2011 The Android Open Source Project +# 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. @@ -16,15 +16,18 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -MAKEDICT_CORE_SOURCE_DIRECTORY := ../../java/src/com/android/inputmethod/latin/makedict +LATINIME_CORE_SOURCE_DIRECTORY := ../../java/src/com/android/inputmethod/latin +MAKEDICT_CORE_SOURCE_DIRECTORY := $(LATINIME_CORE_SOURCE_DIRECTORY)/makedict LOCAL_MAIN_SRC_FILES := $(call all-java-files-under,$(MAKEDICT_CORE_SOURCE_DIRECTORY)) LOCAL_TOOL_SRC_FILES := $(call all-java-files-under,src) LOCAL_SRC_FILES := $(LOCAL_TOOL_SRC_FILES) \ - $(filter-out $(addprefix %, $(LOCAL_TOOL_SRC_FILES)), $(LOCAL_MAIN_SRC_FILES)) -LOCAL_SRC_FILES += $(call all-java-files-under,tests) + $(filter-out $(addprefix %/, $(notdir $(LOCAL_TOOL_SRC_FILES))), $(LOCAL_MAIN_SRC_FILES)) \ + $(call all-java-files-under,tests) \ + $(LATINIME_CORE_SOURCE_DIRECTORY)/Constants.java + LOCAL_JAR_MANIFEST := etc/manifest.txt -LOCAL_MODULE := makedict +LOCAL_MODULE := dicttool_aosp LOCAL_JAVA_LIBRARIES := junit include $(BUILD_HOST_JAVA_LIBRARY) diff --git a/tools/makedict/etc/Android.mk b/tools/dicttool/etc/Android.mk index 1b7d7cf0e..0c611b7e9 100644 --- a/tools/makedict/etc/Android.mk +++ b/tools/dicttool/etc/Android.mk @@ -1,4 +1,4 @@ -# Copyright (C) 2011 The Android Open Source Project +# 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. @@ -15,5 +15,5 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_PREBUILT_EXECUTABLES := makedict +LOCAL_PREBUILT_EXECUTABLES := dicttool_aosp makedict_aosp include $(BUILD_HOST_PREBUILT) diff --git a/tools/makedict/etc/makedict b/tools/dicttool/etc/dicttool_aosp index 7c1c02e85..a4879a279 100755 --- a/tools/makedict/etc/makedict +++ b/tools/dicttool/etc/dicttool_aosp @@ -33,7 +33,7 @@ progdir=`pwd` prog="${progdir}"/`basename "${prog}"` cd "${oldwd}" -jarfile=makedict.jar +jarfile=dicttool_aosp.jar frameworkdir="$progdir" if [ ! -r "$frameworkdir/$jarfile" ] then @@ -58,6 +58,5 @@ else jarpath="$frameworkdir/$jarfile" fi -# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored # might need more memory, e.g. -Xmx128M -exec java -ea -Djava.ext.dirs="$frameworkdir" -jar "$jarpath" "$@" +exec java -ea -jar "$jarpath" "$@" diff --git a/tools/dicttool/etc/makedict_aosp b/tools/dicttool/etc/makedict_aosp new file mode 100755 index 000000000..095c50538 --- /dev/null +++ b/tools/dicttool/etc/makedict_aosp @@ -0,0 +1,18 @@ +#!/bin/sh +# 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. + +# Dicttool supports making the dictionary using the 'makedict' command and +# the same arguments that the old 'makedict' command used to accept. +dicttool_aosp makedict $@ diff --git a/tools/dicttool/etc/manifest.txt b/tools/dicttool/etc/manifest.txt new file mode 100644 index 000000000..67c85214c --- /dev/null +++ b/tools/dicttool/etc/manifest.txt @@ -0,0 +1 @@ +Main-Class: com.android.inputmethod.latin.dicttool.Dicttool diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java new file mode 100644 index 000000000..8d4eb751b --- /dev/null +++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java @@ -0,0 +1,22 @@ +/** + * 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.dicttool; + +public class AdditionalCommandList { + public static void populate() { + } +} diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java new file mode 100644 index 000000000..d16b069fe --- /dev/null +++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java @@ -0,0 +1,26 @@ +/** + * 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.dicttool; + +public class CommandList { + public static void populate() { + Dicttool.addCommand("info", Info.class); + Dicttool.addCommand("compress", Compress.Compressor.class); + Dicttool.addCommand("uncompress", Compress.Uncompressor.class); + Dicttool.addCommand("makedict", Makedict.class); + } +} diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/Compress.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/Compress.java new file mode 100644 index 000000000..3cb0a12c4 --- /dev/null +++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/Compress.java @@ -0,0 +1,98 @@ +/** + * 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.dicttool; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; + +public class Compress { + + private static OutputStream getCompressedStream(final OutputStream out) + throws java.io.IOException { + return new GZIPOutputStream(out); + } + + private static InputStream getUncompressedStream(final InputStream in) throws IOException { + return new GZIPInputStream(in); + } + + public static void copy(final InputStream input, final OutputStream output) throws IOException { + final byte[] buffer = new byte[1000]; + for (int readBytes = input.read(buffer); readBytes >= 0; readBytes = input.read(buffer)) + output.write(buffer, 0, readBytes); + input.close(); + output.close(); + } + + static public class Compressor extends Dicttool.Command { + public static final String COMMAND = "compress"; + public static final String STDIN_OR_STDOUT = "-"; + + public Compressor() { + } + + public String getHelp() { + return COMMAND + " <src_filename> <dst_filename>: " + + "Compresses a file using gzip compression"; + } + + public void run() throws IOException { + if (mArgs.length > 2) { + throw new RuntimeException("Too many arguments for command " + COMMAND); + } + final String inFilename = mArgs.length >= 1 ? mArgs[0] : STDIN_OR_STDOUT; + final String outFilename = mArgs.length >= 2 ? mArgs[1] : STDIN_OR_STDOUT; + final InputStream input = inFilename.equals(STDIN_OR_STDOUT) ? System.in + : new FileInputStream(new File(inFilename)); + final OutputStream output = outFilename.equals(STDIN_OR_STDOUT) ? System.out + : new FileOutputStream(new File(outFilename)); + copy(input, new GZIPOutputStream(output)); + } + } + + static public class Uncompressor extends Dicttool.Command { + public static final String COMMAND = "uncompress"; + public static final String STDIN_OR_STDOUT = "-"; + + public Uncompressor() { + } + + public String getHelp() { + return COMMAND + " <src_filename> <dst_filename>: " + + "Uncompresses a file compressed with gzip compression"; + } + + public void run() throws IOException { + if (mArgs.length > 2) { + throw new RuntimeException("Too many arguments for command " + COMMAND); + } + final String inFilename = mArgs.length >= 1 ? mArgs[0] : STDIN_OR_STDOUT; + final String outFilename = mArgs.length >= 2 ? mArgs[1] : STDIN_OR_STDOUT; + final InputStream input = inFilename.equals(STDIN_OR_STDOUT) ? System.in + : new FileInputStream(new File(inFilename)); + final OutputStream output = outFilename.equals(STDIN_OR_STDOUT) ? System.out + : new FileOutputStream(new File(outFilename)); + copy(new GZIPInputStream(input), output); + } + } +} diff --git a/tools/makedict/src/com/android/inputmethod/latin/makedict/DictionaryMaker.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/DictionaryMaker.java index 5e3921573..4f8874985 100644 --- a/tools/makedict/src/com/android/inputmethod/latin/makedict/DictionaryMaker.java +++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/DictionaryMaker.java @@ -14,7 +14,13 @@ * the License. */ -package com.android.inputmethod.latin.makedict; +package com.android.inputmethod.latin.dicttool; + +import com.android.inputmethod.latin.makedict.BinaryDictInputOutput; +import com.android.inputmethod.latin.makedict.FormatSpec; +import com.android.inputmethod.latin.makedict.FusionDictionary; +import com.android.inputmethod.latin.makedict.MakedictLog; +import com.android.inputmethod.latin.makedict.UnsupportedFormatException; import java.io.File; import java.io.FileInputStream; @@ -22,7 +28,8 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; -import java.io.RandomAccessFile; +import java.nio.ByteBuffer; +import java.nio.channels.FileChannel; import java.util.Arrays; import java.util.LinkedList; @@ -36,40 +43,35 @@ import org.xml.sax.SAXException; public class DictionaryMaker { static class Arguments { - private final static String OPTION_VERSION_2 = "-2"; - private final static String OPTION_INPUT_SOURCE = "-s"; - private final static String OPTION_INPUT_BIGRAM_XML = "-b"; - private final static String OPTION_INPUT_SHORTCUT_XML = "-c"; - private final static String OPTION_OUTPUT_BINARY = "-d"; - private final static String OPTION_OUTPUT_BINARY_FORMAT_VERSION_1 = "-d1"; - private final static String OPTION_OUTPUT_XML = "-x"; - private final static String OPTION_HELP = "-h"; + private static final String OPTION_VERSION_1 = "-1"; + private static final String OPTION_VERSION_2 = "-2"; + private static final String OPTION_VERSION_3 = "-3"; + private static final String OPTION_INPUT_SOURCE = "-s"; + private static final String OPTION_INPUT_BIGRAM_XML = "-b"; + private static final String OPTION_INPUT_SHORTCUT_XML = "-c"; + private static final String OPTION_OUTPUT_BINARY = "-d"; + private static final String OPTION_OUTPUT_XML = "-x"; + private static final String OPTION_HELP = "-h"; public final String mInputBinary; public final String mInputUnigramXml; public final String mInputShortcutXml; public final String mInputBigramXml; public final String mOutputBinary; - public final String mOutputBinaryFormat1; public final String mOutputXml; + public final int mOutputBinaryFormatVersion; private void checkIntegrity() throws IOException { checkHasExactlyOneInput(); checkHasAtLeastOneOutput(); checkNotSameFile(mInputBinary, mOutputBinary); - checkNotSameFile(mInputBinary, mOutputBinaryFormat1); checkNotSameFile(mInputBinary, mOutputXml); checkNotSameFile(mInputUnigramXml, mOutputBinary); - checkNotSameFile(mInputUnigramXml, mOutputBinaryFormat1); checkNotSameFile(mInputUnigramXml, mOutputXml); checkNotSameFile(mInputShortcutXml, mOutputBinary); - checkNotSameFile(mInputShortcutXml, mOutputBinaryFormat1); checkNotSameFile(mInputShortcutXml, mOutputXml); checkNotSameFile(mInputBigramXml, mOutputBinary); - checkNotSameFile(mInputBigramXml, mOutputBinaryFormat1); checkNotSameFile(mInputBigramXml, mOutputXml); - checkNotSameFile(mOutputBinary, mOutputBinaryFormat1); checkNotSameFile(mOutputBinary, mOutputXml); - checkNotSameFile(mOutputBinaryFormat1, mOutputXml); } private void checkHasExactlyOneInput() { @@ -84,7 +86,7 @@ public class DictionaryMaker { } private void checkHasAtLeastOneOutput() { - if (null == mOutputBinary && null == mOutputBinaryFormat1 && null == mOutputXml) { + if (null == mOutputBinary && null == mOutputXml) { throw new RuntimeException("No output specified"); } } @@ -102,19 +104,23 @@ public class DictionaryMaker { } private void displayHelp() { - MakedictLog.i("Usage: makedict " - + "[-s <unigrams.xml> [-b <bigrams.xml>] [-c <shortcuts.xml>] " - + "| -s <binary input>] [-d <binary output format version 2>] " - + "[-d1 <binary output format version 1>] [-x <xml output>] [-2]\n" + MakedictLog.i(getHelp()); + } + + public static String getHelp() { + return "Usage: makedict " + + "[-s <unigrams.xml> [-b <bigrams.xml>] [-c <shortcuts_and_whitelist.xml>] " + + "| [-s <binary input>] [-d <binary output>] [-x <xml output>] " + + "[-1] [-2] [-3]\n" + "\n" + " Converts a source dictionary file to one or several outputs.\n" + " Source can be an XML file, with an optional XML bigrams file, or a\n" + " binary dictionary file.\n" - + " Binary version 1 (Ice Cream Sandwich), 2 (Jelly Bean) and XML outputs\n" + + " Binary version 1 (Ice Cream Sandwich), 2 (Jelly Bean), 3 and XML outputs\n" + " are supported. All three can be output at the same time, but the same\n" + " output format cannot be specified several times. The behavior is\n" + " unspecified if the same file is specified for input and output, or for\n" - + " several outputs."); + + " several outputs."; } public Arguments(String[] argsArray) throws IOException { @@ -127,8 +133,8 @@ public class DictionaryMaker { String inputShortcutXml = null; String inputBigramXml = null; String outputBinary = null; - String outputBinaryFormat1 = null; String outputXml = null; + int outputBinaryFormatVersion = 2; // the default version is 2. while (!args.isEmpty()) { final String arg = args.get(0); @@ -136,6 +142,10 @@ 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 = 3; + } else if (OPTION_VERSION_1.equals(arg)) { + outputBinaryFormatVersion = 1; } else if (OPTION_HELP.equals(arg)) { displayHelp(); } else { @@ -158,8 +168,6 @@ public class DictionaryMaker { inputBigramXml = filename; } else if (OPTION_OUTPUT_BINARY.equals(arg)) { outputBinary = filename; - } else if (OPTION_OUTPUT_BINARY_FORMAT_VERSION_1.equals(arg)) { - outputBinaryFormat1 = filename; } else if (OPTION_OUTPUT_XML.equals(arg)) { outputXml = filename; } else { @@ -186,8 +194,8 @@ public class DictionaryMaker { mInputShortcutXml = inputShortcutXml; mInputBigramXml = inputBigramXml; mOutputBinary = outputBinary; - mOutputBinaryFormat1 = outputBinaryFormat1; mOutputXml = outputXml; + mOutputBinaryFormatVersion = outputBinaryFormatVersion; checkIntegrity(); } } @@ -229,15 +237,31 @@ public class DictionaryMaker { */ private static FusionDictionary readBinaryFile(final String binaryFilename) throws FileNotFoundException, IOException, UnsupportedFormatException { - final RandomAccessFile inputFile = new RandomAccessFile(binaryFilename, "r"); - return BinaryDictInputOutput.readDictionaryBinary(inputFile, null); + FileInputStream inStream = null; + + try { + final File file = new File(binaryFilename); + inStream = new FileInputStream(file); + final ByteBuffer buffer = inStream.getChannel().map( + FileChannel.MapMode.READ_ONLY, 0, file.length()); + return BinaryDictInputOutput.readDictionaryBinary( + new BinaryDictInputOutput.ByteBufferWrapper(buffer), null); + } finally { + if (inStream != null) { + try { + inStream.close(); + } catch (IOException e) { + // do nothing + } + } + } } /** * Read a dictionary from a unigram XML file, and optionally a bigram XML file. * * @param unigramXmlFilename the name of the unigram XML file. May not be null. - * @param shortcutXmlFilename the name of the shortcut XML file, or null if there is none. + * @param shortcutXmlFilename the name of the shortcut/whitelist XML file, or null if none. * @param bigramXmlFilename the name of the bigram XML file. Pass null if there are no bigrams. * @return the read dictionary. * @throws FileNotFoundException if one of the files can't be found @@ -269,10 +293,7 @@ public class DictionaryMaker { throws FileNotFoundException, IOException, UnsupportedFormatException, IllegalArgumentException { if (null != args.mOutputBinary) { - writeBinaryDictionary(args.mOutputBinary, dict, 2); - } - if (null != args.mOutputBinaryFormat1) { - writeBinaryDictionary(args.mOutputBinaryFormat1, dict, 1); + writeBinaryDictionary(args.mOutputBinary, dict, args.mOutputBinaryFormatVersion); } if (null != args.mOutputXml) { writeXmlDictionary(args.mOutputXml, dict); @@ -292,8 +313,9 @@ public class DictionaryMaker { final FusionDictionary dict, final int version) throws FileNotFoundException, IOException, UnsupportedFormatException { final File outputFile = new File(outputFilename); + final FormatSpec.FormatOptions formatOptions = new FormatSpec.FormatOptions(version); BinaryDictInputOutput.writeDictionaryBinary(new FileOutputStream(outputFilename), dict, - version); + formatOptions); } /** diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java new file mode 100644 index 000000000..bf417fb5a --- /dev/null +++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java @@ -0,0 +1,94 @@ +/** + * 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.dicttool; + +import java.util.Arrays; +import java.util.HashMap; + +public class Dicttool { + + public static abstract class Command { + protected String[] mArgs; + public void setArgs(String[] args) throws IllegalArgumentException { + mArgs = args; + } + abstract public String getHelp(); + abstract public void run() throws Exception; + } + static HashMap<String, Class<? extends Command>> sCommands = + new HashMap<String, Class<? extends Command>>(); + static { + CommandList.populate(); + AdditionalCommandList.populate(); + } + public static void addCommand(final String commandName, final Class<? extends Command> cls) { + sCommands.put(commandName, cls); + } + + private static Command getCommandInstance(final String commandName) { + try { + return sCommands.get(commandName).newInstance(); + } catch (InstantiationException e) { + throw new RuntimeException(commandName + " is not installed"); + } catch (IllegalAccessException e) { + throw new RuntimeException(commandName + " is not installed"); + } + } + + private static void help() { + System.out.println("Syntax: dicttool <command [arguments]>\nAvailable commands:\n"); + for (final String commandName : sCommands.keySet()) { + System.out.println("*** " + commandName); + System.out.println(getCommandInstance(commandName).getHelp()); + System.out.println(""); + } + } + + private static boolean isCommand(final String commandName) { + return sCommands.containsKey(commandName); + } + + private Command getCommand(final String[] arguments) { + final String commandName = arguments[0]; + if (!isCommand(commandName)) { + throw new RuntimeException("Unknown command : " + commandName); + } + final Command command = getCommandInstance(commandName); + final String[] argsArray = Arrays.copyOfRange(arguments, 1, arguments.length); + command.setArgs(argsArray); + return command; + } + + private void execute(final String[] arguments) { + final Command command = getCommand(arguments); + try { + command.run(); + } catch (Exception e) { + System.out.println("Exception while processing command " + + command.getClass().getSimpleName() + " : " + e); + return; + } + } + + public static void main(final String[] arguments) { + if (0 == arguments.length) { + help(); + return; + } + new Dicttool().execute(arguments); + } +} diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/Info.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/Info.java new file mode 100644 index 000000000..e59261706 --- /dev/null +++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/Info.java @@ -0,0 +1,36 @@ +/** + * 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.dicttool; + +public class Info extends Dicttool.Command { + public static final String COMMAND = "info"; + + public Info() { + } + + public String getHelp() { + return "info <filename>: prints various information about a dictionary file"; + } + + public void run() { + // TODO: implement this + if (mArgs.length < 1) { + throw new RuntimeException("Not enough arguments for command " + COMMAND); + } + System.out.println("Not implemented yet"); + } +} diff --git a/tools/dicttool/src/android/inputmethod/latin/dicttool/Makedict.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/Makedict.java new file mode 100644 index 000000000..c004cfbe4 --- /dev/null +++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/Makedict.java @@ -0,0 +1,40 @@ +/** + * 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.dicttool; + +import com.android.inputmethod.latin.makedict.UnsupportedFormatException; + +import java.io.FileNotFoundException; +import java.io.IOException; +import javax.xml.parsers.ParserConfigurationException; +import org.xml.sax.SAXException; + +public class Makedict extends Dicttool.Command { + public static final String COMMAND = "makedict"; + + public Makedict() { + } + + public String getHelp() { + return DictionaryMaker.Arguments.getHelp(); + } + + public void run() throws FileNotFoundException, IOException, ParserConfigurationException, + SAXException, UnsupportedFormatException { + DictionaryMaker.main(mArgs); + } +} diff --git a/tools/makedict/src/com/android/inputmethod/latin/makedict/MakedictLog.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/MakedictLog.java index 7eccff2b4..7eccff2b4 100644 --- a/tools/makedict/src/com/android/inputmethod/latin/makedict/MakedictLog.java +++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/MakedictLog.java diff --git a/tools/makedict/src/com/android/inputmethod/latin/makedict/XmlDictInputOutput.java b/tools/dicttool/src/android/inputmethod/latin/dicttool/XmlDictInputOutput.java index 52f124dfb..c31cd724a 100644 --- a/tools/makedict/src/com/android/inputmethod/latin/makedict/XmlDictInputOutput.java +++ b/tools/dicttool/src/android/inputmethod/latin/dicttool/XmlDictInputOutput.java @@ -14,11 +14,13 @@ * the License. */ -package com.android.inputmethod.latin.makedict; +package com.android.inputmethod.latin.dicttool; +import com.android.inputmethod.latin.makedict.FusionDictionary; import com.android.inputmethod.latin.makedict.FusionDictionary.DictionaryOptions; import com.android.inputmethod.latin.makedict.FusionDictionary.Node; import com.android.inputmethod.latin.makedict.FusionDictionary.WeightedString; +import com.android.inputmethod.latin.makedict.Word; import java.io.IOException; import java.io.InputStream; @@ -48,6 +50,7 @@ public class XmlDictInputOutput { private static final String SHORTCUT_TAG = "shortcut"; private static final String FREQUENCY_ATTR = "f"; private static final String WORD_ATTR = "word"; + private static final String NOT_A_WORD_ATTR = "not_a_word"; private static final int SHORTCUT_ONLY_DEFAULT_FREQ = 1; @@ -88,6 +91,10 @@ public class XmlDictInputOutput { public FusionDictionary getFinalDictionary() { final FusionDictionary dict = mDictionary; + for (final String shortcutOnly : mShortcutsMap.keySet()) { + if (dict.hasWord(shortcutOnly)) continue; + dict.add(shortcutOnly, 0, mShortcutsMap.get(shortcutOnly), true /* isNotAWord */); + } mDictionary = null; mShortcutsMap.clear(); mWord = ""; @@ -138,7 +145,7 @@ public class XmlDictInputOutput { @Override public void endElement(String uri, String localName, String qName) { if (WORD == mState) { - mDictionary.add(mWord, mFreq, mShortcutsMap.get(mWord)); + mDictionary.add(mWord, mFreq, mShortcutsMap.get(mWord), false /* isNotAWord */); mState = START; } } @@ -177,7 +184,7 @@ public class XmlDictInputOutput { mSrc = attrs.getValue(uri, SRC_ATTRIBUTE); } else if (DST_TAG.equals(localName)) { String dst = attrs.getValue(uri, DST_ATTRIBUTE); - int freq = Integer.parseInt(attrs.getValue(uri, DST_FREQ)); + int freq = getValueFromFreqString(attrs.getValue(uri, DST_FREQ)); WeightedString bigram = new WeightedString(dst, freq / XML_TO_MEMORY_RATIO); ArrayList<WeightedString> bigramList = mAssocMap.get(mSrc); if (null == bigramList) bigramList = new ArrayList<WeightedString>(); @@ -186,6 +193,10 @@ public class XmlDictInputOutput { } } + protected int getValueFromFreqString(final String freqString) { + return Integer.parseInt(freqString); + } + // This may return an empty map, but will never return null. public HashMap<String, ArrayList<WeightedString>> getAssocMap() { return mAssocMap; @@ -214,22 +225,40 @@ public class XmlDictInputOutput { } /** - * SAX handler for a shortcut XML file. + * SAX handler for a shortcut & whitelist XML file. */ - static private class ShortcutHandler extends AssociativeListHandler { + static private class ShortcutAndWhitelistHandler extends AssociativeListHandler { private final static String ENTRY_TAG = "entry"; private final static String ENTRY_ATTRIBUTE = "shortcut"; private final static String TARGET_TAG = "target"; private final static String REPLACEMENT_ATTRIBUTE = "replacement"; private final static String TARGET_PRIORITY_ATTRIBUTE = "priority"; + private final static String WHITELIST_MARKER = "whitelist"; + private final static int WHITELIST_FREQ_VALUE = 15; + private final static int MIN_FREQ = 0; + private final static int MAX_FREQ = 14; - public ShortcutHandler() { + public ShortcutAndWhitelistHandler() { super(ENTRY_TAG, ENTRY_ATTRIBUTE, TARGET_TAG, REPLACEMENT_ATTRIBUTE, TARGET_PRIORITY_ATTRIBUTE); } + @Override + protected int getValueFromFreqString(final String freqString) { + if (WHITELIST_MARKER.equals(freqString)) { + return WHITELIST_FREQ_VALUE; + } else { + final int intValue = super.getValueFromFreqString(freqString); + if (intValue < MIN_FREQ || intValue > MAX_FREQ) { + throw new RuntimeException("Shortcut freq out of range. Accepted range is " + + MIN_FREQ + ".." + MAX_FREQ); + } + return intValue; + } + } + // As per getAssocMap(), this never returns null. - public HashMap<String, ArrayList<WeightedString>> getShortcutMap() { + public HashMap<String, ArrayList<WeightedString>> getShortcutAndWhitelistMap() { return getAssocMap(); } } @@ -241,7 +270,7 @@ public class XmlDictInputOutput { * representation. * * @param unigrams the file to read the data from. - * @param shortcuts the file to read the shortcuts from, or null. + * @param shortcuts the file to read the shortcuts & whitelist from, or null. * @param bigrams the file to read the bigrams from, or null. * @return the in-memory representation of the dictionary. */ @@ -254,11 +283,12 @@ public class XmlDictInputOutput { final BigramHandler bigramHandler = new BigramHandler(); if (null != bigrams) parser.parse(bigrams, bigramHandler); - final ShortcutHandler shortcutHandler = new ShortcutHandler(); - if (null != shortcuts) parser.parse(shortcuts, shortcutHandler); + final ShortcutAndWhitelistHandler shortcutAndWhitelistHandler = + new ShortcutAndWhitelistHandler(); + if (null != shortcuts) parser.parse(shortcuts, shortcutAndWhitelistHandler); final UnigramHandler unigramHandler = - new UnigramHandler(shortcutHandler.getShortcutMap()); + new UnigramHandler(shortcutAndWhitelistHandler.getShortcutAndWhitelistMap()); parser.parse(unigrams, unigramHandler); final FusionDictionary dict = unigramHandler.getFinalDictionary(); final HashMap<String, ArrayList<WeightedString>> bigramMap = bigramHandler.getBigramMap(); @@ -278,7 +308,7 @@ public class XmlDictInputOutput { * * This method reads data from the parser and creates a new FusionDictionary with it. * The format parsed by this method is the format used before Ice Cream Sandwich, - * which has no support for bigrams or shortcuts. + * which has no support for bigrams or shortcuts/whitelist. * It is important to note that this method expects the parser to have already eaten * the first, all-encompassing tag. * @@ -289,7 +319,7 @@ public class XmlDictInputOutput { /** * Writes a dictionary to an XML file. * - * The output format is the "second" format, which supports bigrams and shortcuts. + * The output format is the "second" format, which supports bigrams and shortcuts/whitelist. * * @param destination a destination stream to write to. * @param dict the dictionary to write. @@ -316,7 +346,8 @@ public class XmlDictInputOutput { destination.write("<!-- Warning: there is no code to read this format yet. -->\n"); for (Word word : set) { destination.write(" <" + WORD_TAG + " " + WORD_ATTR + "=\"" + word.mWord + "\" " - + FREQUENCY_ATTR + "=\"" + word.mFrequency + "\">"); + + FREQUENCY_ATTR + "=\"" + word.mFrequency + + (word.mIsNotAWord ? "\" " + NOT_A_WORD_ATTR + "=\"true" : "") + "\">"); if (null != word.mShortcutTargets) { destination.write("\n"); for (WeightedString target : word.mShortcutTargets) { diff --git a/tools/makedict/tests/com/android/inputmethod/latin/BinaryDictInputOutputTest.java b/tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictInputOutputTest.java index 24042f120..88589b815 100644 --- a/tools/makedict/tests/com/android/inputmethod/latin/BinaryDictInputOutputTest.java +++ b/tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictInputOutputTest.java @@ -43,11 +43,11 @@ public class BinaryDictInputOutputTest extends TestCase { final FusionDictionary dict = new FusionDictionary(new Node(), new DictionaryOptions(new HashMap<String, String>(), false /* germanUmlautProcessing */, false /* frenchLigatureProcessing */)); - dict.add("foo", 1, null); - dict.add("fta", 1, null); - dict.add("ftb", 1, null); - dict.add("bar", 1, null); - dict.add("fool", 1, null); + dict.add("foo", 1, null, false /* isNotAWord */); + dict.add("fta", 1, null, false /* isNotAWord */); + dict.add("ftb", 1, null, false /* isNotAWord */); + dict.add("bar", 1, null, false /* isNotAWord */); + dict.add("fool", 1, null, false /* isNotAWord */); final ArrayList<Node> result = BinaryDictInputOutput.flattenTree(dict.mRoot); assertEquals(4, result.size()); while (!result.isEmpty()) { diff --git a/tools/dicttool/tests/etc/test-dicttool.sh b/tools/dicttool/tests/etc/test-dicttool.sh new file mode 100755 index 000000000..8834611cd --- /dev/null +++ b/tools/dicttool/tests/etc/test-dicttool.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 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. + +java -classpath ${ANDROID_HOST_OUT}/framework/junit.jar:${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES/dicttool_intermediates/classes junit.textui.TestRunner com.android.inputmethod.latin.makedict.BinaryDictInputOutputTest diff --git a/tools/makedict/etc/manifest.txt b/tools/makedict/etc/manifest.txt deleted file mode 100644 index 4f085e7c8..000000000 --- a/tools/makedict/etc/manifest.txt +++ /dev/null @@ -1 +0,0 @@ -Main-Class: com.android.inputmethod.latin.makedict.DictionaryMaker diff --git a/tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl b/tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl index f6c84eaf2..774094cd7 100644 --- a/tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl +++ b/tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl @@ -19,6 +19,7 @@ package com.android.inputmethod.keyboard.internal; import android.content.Context; import android.content.res.Resources; +import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.R; import java.util.HashMap; @@ -45,14 +46,12 @@ import java.util.HashMap; */ public final class KeyboardTextsSet { // Language to texts map. - private static final HashMap<String, String[]> sLocaleToTextsMap = - new HashMap<String, String[]>(); - private static final HashMap<String, Integer> sNameToIdsMap = - new HashMap<String, Integer>(); + private static final HashMap<String, String[]> sLocaleToTextsMap = CollectionUtils.newHashMap(); + private static final HashMap<String, Integer> sNameToIdsMap = CollectionUtils.newHashMap(); private String[] mTexts; // Resource name to text map. - private HashMap<String, String> mResourceNameToTextsMap = new HashMap<String, String>(); + private HashMap<String, String> mResourceNameToTextsMap = CollectionUtils.newHashMap(); public void setLanguage(final String language) { mTexts = sLocaleToTextsMap.get(language); diff --git a/tools/maketext/res/values-af/donottranslate-more-keys.xml b/tools/maketext/res/values-af/donottranslate-more-keys.xml new file mode 100644 index 000000000..ee96f442d --- /dev/null +++ b/tools/maketext/res/values-af/donottranslate-more-keys.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- This is the same as Dutch except more keys of y and demoting vowels with diaeresis. --> + <!-- U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE + U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX + U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS + U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE + U+00E6: "æ" LATIN SMALL LETTER AE + U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE + U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE + U+0101: "ā" LATIN SMALL LETTER A WITH MACRON --> + <string name="more_keys_for_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 + U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS + U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK + U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE + U+0113: "ē" LATIN SMALL LETTER E WITH MACRON --> + <string name="more_keys_for_e">é,è,ê,ë,ę,ė,ē</string> + <!-- U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE + U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE + U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS + U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX + U+012F: "į" LATIN SMALL LETTER I WITH OGONEK + U+012B: "ī" LATIN SMALL LETTER I WITH MACRON + U+0133: "ij" LATIN SMALL LIGATURE IJ --> + <string name="more_keys_for_i">í,ì,ï,î,į,ī,ij</string> + <!-- U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE + U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX + U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS + U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE + U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE + U+0153: "œ" LATIN SMALL LIGATURE OE + U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE + U+014D: "ō" LATIN SMALL LETTER O WITH MACRON --> + <string name="more_keys_for_o">ó,ô,ö,ò,õ,œ,ø,ō</string> + <!-- U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE + U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX + U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS + U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE + U+016B: "ū" LATIN SMALL LETTER U WITH MACRON --> + <string name="more_keys_for_u">ú,û,ü,ù,ū</string> + <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE + U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE --> + <string name="more_keys_for_n">ñ,ń</string> + <string name="more_keys_for_y">ý,ŷ,ÿ,ij</string> + <!-- U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE + U+0133: "ij" LATIN SMALL LIGATURE IJ --> + <string name="more_keys_for_y">ý,ij</string> +</resources> diff --git a/tools/maketext/res/values-be/donottranslate-more-keys.xml b/tools/maketext/res/values-be/donottranslate-more-keys.xml index 835553a1f..a2056e932 100644 --- a/tools/maketext/res/values-be/donottranslate-more-keys.xml +++ b/tools/maketext/res/values-be/donottranslate-more-keys.xml @@ -20,12 +20,16 @@ <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- U+045E: "ў" CYRILLIC SMALL LETTER SHORT U --> <string name="keylabel_for_east_slavic_row1_9">ў</string> + <!-- U+0451: "ё" CYRILLIC SMALL LETTER IO --> + <string name="keylabel_for_east_slavic_row1_12">ё</string> <!-- U+044B: "ы" CYRILLIC SMALL LETTER YERU --> <string name="keylabel_for_east_slavic_row2_1">ы</string> + <!-- U+044D: "э" CYRILLIC SMALL LETTER E --> + <string name="keylabel_for_east_slavic_row2_11">э</string> <!-- U+0456: "і" CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I --> <string name="keylabel_for_east_slavic_row3_5">і</string> - <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN --> - <string name="more_keys_for_cyrillic_ha">ъ</string> + <!-- U+0451: "ё" CYRILLIC SMALL LETTER IO --> + <string name="more_keys_for_cyrillic_ie">ё</string> <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN --> <string name="more_keys_for_cyrillic_soft_sign">ъ</string> </resources> diff --git a/tools/maketext/res/values-eo/donottranslate-more-keys.xml b/tools/maketext/res/values-eo/donottranslate-more-keys.xml new file mode 100644 index 000000000..e929869e2 --- /dev/null +++ b/tools/maketext/res/values-eo/donottranslate-more-keys.xml @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- 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+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS + U+00E6: "æ" LATIN SMALL LETTER AE + U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE + U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE + U+0101: "ā" LATIN SMALL LETTER A WITH MACRON + U+0103: "ă" LATIN SMALL LETTER A WITH BREVE + U+0105: "ą" LATIN SMALL LETTER A WITH OGONEK + U+00AA: "ª" FEMININE ORDINAL INDICATOR --> + <string name="more_keys_for_a">á,à,â,ä,æ,ã,å,ā,ă,ą,ª</string> + <!-- U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE + U+011B: "ě" LATIN SMALL LETTER E WITH CARON + U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE + U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX + U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS + U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK + U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE + U+0113: "ē" LATIN SMALL LETTER E WITH MACRON --> + <string name="more_keys_for_e">é,ě,è,ê,ë,ę,ė,ē</string> + <!-- U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE + U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX + U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS + U+0129: "ĩ" LATIN SMALL LETTER I WITH TILDE + U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE + U+012F: "į" LATIN SMALL LETTER I WITH OGONEK + U+012B: "ī" LATIN SMALL LETTER I WITH MACRON + U+0131: "ı" LATIN SMALL LETTER DOTLESS I + U+0133: "ij" LATIN SMALL LIGATURE IJ --> + <string name="more_keys_for_i">í,î,ï,ĩ,ì,į,ī,ı,ij</string> + <!-- U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE + 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+00F5: "õ" LATIN SMALL LETTER O WITH TILDE + U+0153: "œ" LATIN SMALL LIGATURE OE + U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE + U+014D: "ō" LATIN SMALL LETTER O WITH MACRON + U+0151: "ő" LATIN SMALL LETTER O WITH DOUBLE ACUTE + U+00BA: "º" MASCULINE ORDINAL INDICATOR --> + <string name="more_keys_for_o">ó,ö,ô,ò,õ,œ,ø,ō,ő,º</string> + <!-- U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE + U+016F: "ů" LATIN SMALL LETTER U WITH RING ABOVE + U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX + U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS + U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE + U+016B: "ū" LATIN SMALL LETTER U WITH MACRON + U+0169: "ũ" LATIN SMALL LETTER U WITH TILDE + U+0171: "ű" LATIN SMALL LETTER U WITH DOUBLE ACUTE + U+0173: "ų" LATIN SMALL LETTER U WITH OGONEK + U+00B5: "µ" MICRO SIGN --> + <string name="more_keys_for_u">ú,ů,û,ü,ù,ū,ũ,ű,ų,µ</string> + <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S + U+0161: "š" LATIN SMALL LETTER S WITH CARON + U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE + U+0219: "ș" LATIN SMALL LETTER S WITH COMMA BELOW + U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA --> + <string name="more_keys_for_s">ß,š,ś,ș,ş</string> + <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE + U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE + U+0146: "ņ" LATIN SMALL LETTER N WITH CEDILLA + U+0148: "ň" LATIN SMALL LETTER N WITH CARON + U+0149: "ʼn" LATIN SMALL LETTER N PRECEDED BY APOSTROPHE + U+014B: "ŋ" LATIN SMALL LETTER ENG --> + <string name="more_keys_for_n">ñ,ń,ņ,ň,ʼn,ŋ</string> + <!-- U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE + U+010D: "č" LATIN SMALL LETTER C WITH CARON + U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA + U+010B: "ċ" LATIN SMALL LETTER C WITH DOT ABOVE --> + <string name="more_keys_for_c">ć,č,ç,ċ</string> + <!-- U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE + U+0177: "ŷ" LATIN SMALL LETTER Y WITH CIRCUMFLEX + U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS + U+00FE: "þ" LATIN SMALL LETTER THORN --> + <string name="more_keys_for_y">y,ý,ŷ,ÿ,þ</string> + <!-- U+00F0: "ð" LATIN SMALL LETTER ETH + U+010F: "ď" LATIN SMALL LETTER D WITH CARON + U+0111: "đ" LATIN SMALL LETTER D WITH STROKE --> + <string name="more_keys_for_d">ð,ď,đ</string> + <!-- U+0159: "ř" LATIN SMALL LETTER R WITH CARON + U+0155: "ŕ" LATIN SMALL LETTER R WITH ACUTE + U+0157: "ŗ" LATIN SMALL LETTER R WITH CEDILLA --> + <string name="more_keys_for_r">ř,ŕ,ŗ</string> + <!-- U+0165: "ť" LATIN SMALL LETTER T WITH CARON + U+021B: "ț" LATIN SMALL LETTER T WITH COMMA BELOW + U+0163: "ţ" LATIN SMALL LETTER T WITH CEDILLA + U+0167: "ŧ" LATIN SMALL LETTER T WITH STROKE --> + <string name="more_keys_for_t">ť,ț,ţ,ŧ</string> + <!-- U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE + U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE + U+017E: "ž" LATIN SMALL LETTER Z WITH CARON --> + <string name="more_keys_for_z">ź,ż,ž</string> + <!-- U+0137: "ķ" LATIN SMALL LETTER K WITH CEDILLA + U+0138: "ĸ" LATIN SMALL LETTER KRA --> + <string name="more_keys_for_k">ķ,ĸ</string> + <!-- U+013A: "ĺ" LATIN SMALL LETTER L WITH ACUTE + U+013C: "ļ" LATIN SMALL LETTER L WITH CEDILLA + U+013E: "ľ" LATIN SMALL LETTER L WITH CARON + U+0140: "ŀ" LATIN SMALL LETTER L WITH MIDDLE DOT + U+0142: "ł" LATIN SMALL LETTER L WITH STROKE --> + <string name="more_keys_for_l">ĺ,ļ,ľ,ŀ,ł</string> + <!-- U+011F: "ğ" LATIN SMALL LETTER G WITH BREVE + U+0121: "ġ" LATIN SMALL LETTER G WITH DOT ABOVE + U+0123: "ģ" LATIN SMALL LETTER G WITH CEDILLA --> + <string name="more_keys_for_g">ğ,ġ,ģ</string> + <!-- U+0175: "ŵ" LATIN SMALL LETTER W WITH CIRCUMFLEX --> + <string name="more_keys_for_v">w,ŵ</string> + <!-- U+0125: "ĥ" LATIN SMALL LETTER H WITH CIRCUMFLEX + U+0127: "ħ" LATIN SMALL LETTER H WITH STROKE --> + <string name="more_keys_for_h">ĥ,ħ</string> + <!-- U+0175: "ŵ" LATIN SMALL LETTER W WITH CIRCUMFLEX --> + <string name="more_keys_for_w">w,ŵ</string> + <string name="more_keys_for_q">q</string> + <string name="more_keys_for_x">x</string> + <!-- U+015D: "ŝ" LATIN SMALL LETTER S WITH CIRCUMFLEX --> + <string name="keylabel_for_q">ŝ</string> + <!-- U+011D: "ĝ" LATIN SMALL LETTER G WITH CIRCUMFLEX --> + <string name="keylabel_for_w">ĝ</string> + <!-- U+016D: "ŭ" LATIN SMALL LETTER U WITH BREVE --> + <string name="keylabel_for_y">ŭ</string> + <!-- U+0109: "ĉ" LATIN SMALL LETTER C WITH CIRCUMFLEX --> + <string name="keylabel_for_x">ĉ</string> + <!-- U+0135: "ĵ" LATIN SMALL LETTER J WITH CIRCUMFLEX --> + <string name="keylabel_for_spanish_row2_10">ĵ</string> +</resources> diff --git a/tools/maketext/res/values-es/donottranslate-more-keys.xml b/tools/maketext/res/values-es/donottranslate-more-keys.xml index 2077af464..586dbade8 100644 --- a/tools/maketext/res/values-es/donottranslate-more-keys.xml +++ b/tools/maketext/res/values-es/donottranslate-more-keys.xml @@ -69,15 +69,9 @@ <string name="more_keys_for_c">ç,ć,č</string> <!-- U+00A1: "¡" INVERTED EXCLAMATION MARK U+00BF: "¿" INVERTED QUESTION MARK --> - <string name="more_keys_for_punctuation">"!fixedColumnOrder!9,\",\',#,-,¡,!,¿,\\,,\?,\@,&,\\%,+,;,:,/,(,)"</string> - <string name="keyhintlabel_for_tablet_comma">¡</string> - <string name="more_keys_for_tablet_comma">"¡,!"</string> - <string name="keyhintlabel_for_tablet_period">¿</string> - <string name="more_keys_for_tablet_period">"¿,\?"</string> + <string name="more_keys_for_punctuation">"!fixedColumnOrder!9,¡,\",\',#,-,:,!,\\,,\?,¿,\@,&,\\%,+,;,/,(,)"</string> <!-- U+00A1: "¡" INVERTED EXCLAMATION MARK --> - <string name="keylabel_for_symbols_exclamation">"¡"</string> + <string name="more_keys_for_tablet_comma">"!,¡"</string> <!-- U+00BF: "¿" INVERTED QUESTION MARK --> - <string name="keylabel_for_symbols_question">"¿"</string> - <string name="more_keys_for_symbols_exclamation">"!"</string> - <string name="more_keys_for_symbols_question">"\?"</string> + <string name="more_keys_for_tablet_period">"\?,¿"</string> </resources> diff --git a/tools/maketext/res/values-ky/donottranslate-more-keys.xml b/tools/maketext/res/values-ky/donottranslate-more-keys.xml index fd90248b2..a11ecf942 100644 --- a/tools/maketext/res/values-ky/donottranslate-more-keys.xml +++ b/tools/maketext/res/values-ky/donottranslate-more-keys.xml @@ -20,16 +20,20 @@ <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- U+0449: "щ" CYRILLIC SMALL LETTER SHCHA --> <string name="keylabel_for_east_slavic_row1_9">щ</string> + <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN --> + <string name="keylabel_for_east_slavic_row1_12">ъ</string> <!-- U+044B: "ы" CYRILLIC SMALL LETTER YERU --> <string name="keylabel_for_east_slavic_row2_1">ы</string> + <!-- U+044D: "э" CYRILLIC SMALL LETTER E --> + <string name="keylabel_for_east_slavic_row2_11">э</string> <!-- U+0438: "и" CYRILLIC SMALL LETTER I --> <string name="keylabel_for_east_slavic_row3_5">и</string> <!-- U+04AF: "ү" CYRILLIC SMALL LETTER STRAIGHT U --> <string name="more_keys_for_cyrillic_u">ү</string> + <!-- U+0451: "ё" CYRILLIC SMALL LETTER IO --> + <string name="more_keys_for_cyrillic_ie">ё</string> <!-- U+04A3: "ң" CYRILLIC SMALL LETTER EN WITH DESCENDER --> <string name="more_keys_for_cyrillic_en">ң</string> - <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN --> - <string name="more_keys_for_cyrillic_ha">ъ</string> <!-- U+04E9: "ө" CYRILLIC SMALL LETTER BARRED O --> <string name="more_keys_for_cyrillic_o">ө</string> <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN --> diff --git a/tools/maketext/res/values-ru/donottranslate-more-keys.xml b/tools/maketext/res/values-ru/donottranslate-more-keys.xml index 0bb57074c..82bed784e 100644 --- a/tools/maketext/res/values-ru/donottranslate-more-keys.xml +++ b/tools/maketext/res/values-ru/donottranslate-more-keys.xml @@ -20,14 +20,16 @@ <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- U+0449: "щ" CYRILLIC SMALL LETTER SHCHA --> <string name="keylabel_for_east_slavic_row1_9">щ</string> + <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN --> + <string name="keylabel_for_east_slavic_row1_12">ъ</string> <!-- U+044B: "ы" CYRILLIC SMALL LETTER YERU --> <string name="keylabel_for_east_slavic_row2_1">ы</string> + <!-- U+044D: "э" CYRILLIC SMALL LETTER E --> + <string name="keylabel_for_east_slavic_row2_11">э</string> <!-- U+0438: "и" CYRILLIC SMALL LETTER I --> <string name="keylabel_for_east_slavic_row3_5">и</string> <!-- U+0451: "ё" CYRILLIC SMALL LETTER IO --> - <string name="more_keys_for_cyrillic_ye">ё</string> - <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN --> - <string name="more_keys_for_cyrillic_ha">ъ</string> + <string name="more_keys_for_cyrillic_ie">ё</string> <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN --> <string name="more_keys_for_cyrillic_soft_sign">ъ</string> </resources> diff --git a/tools/maketext/res/values-sr/donottranslate-more-keys.xml b/tools/maketext/res/values-sr/donottranslate-more-keys.xml index e85d3d7a2..dcf0e857e 100644 --- a/tools/maketext/res/values-sr/donottranslate-more-keys.xml +++ b/tools/maketext/res/values-sr/donottranslate-more-keys.xml @@ -18,6 +18,24 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- TODO: Move these to sr-Latn once we can handle IETF language tag with script name specified. + BEGIN: More keys definitions for Serbian (Latin) + U+0161: "š" LATIN SMALL LETTER S WITH CARON + U+00DF: "ß" LATIN SMALL LETTER SHARP S + U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE + <string name="more_keys_for_s">š,ß,ś</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 + <string name="more_keys_for_c">č,ç,ć</string> + U+010F: "ď" LATIN SMALL LETTER D WITH CARON + <string name="more_keys_for_d">ď</string> + U+017E: "ž" LATIN SMALL LETTER Z WITH CARON + U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE + U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE + <string name="more_keys_for_z">ž,ź,ż</string> + END: More keys definitions for Serbian (Latin) --> + <!-- BEGIN: More keys definitions for Serbian (Cyrillic) --> <!-- U+0437: "з" CYRILLIC SMALL LETTER ZE --> <string name="keylabel_for_south_slavic_row1_6">з</string> <!-- U+045B: "ћ" CYRILLIC SMALL LETTER TSHE --> @@ -30,6 +48,7 @@ <string name="more_keys_for_cyrillic_ie">ѐ</string> <!-- U+045D: "ѝ" CYRILLIC SMALL LETTER I WITH GRAVE --> <string name="more_keys_for_cyrillic_i">ѝ</string> + <!-- END: More keys definitions for Serbian (Cyrillic) --> <!-- U+2018: "‘" LEFT SINGLE QUOTATION MARK U+2019: "’" RIGHT SINGLE QUOTATION MARK U+201A: "‚" SINGLE LOW-9 QUOTATION MARK diff --git a/tools/maketext/res/values-sw/donottranslate-more-keys.xml b/tools/maketext/res/values-sw/donottranslate-more-keys.xml new file mode 100644 index 000000000..968a80c1c --- /dev/null +++ b/tools/maketext/res/values-sw/donottranslate-more-keys.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- This is the same as English except more_keys_for_g. --> + <!-- 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+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS + U+00E6: "æ" LATIN SMALL LETTER AE + U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE + U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE + U+0101: "ā" LATIN SMALL LETTER A WITH MACRON --> + <string name="more_keys_for_a">à,á,â,ä,æ,ã,å,ā</string> + <!-- U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE + U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE + U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX + U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS + U+0113: "ē" LATIN SMALL LETTER E WITH MACRON --> + <string name="more_keys_for_e">è,é,ê,ë,ē</string> + <!-- U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX + U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS + U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE + U+012B: "ī" LATIN SMALL LETTER I WITH MACRON + U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE --> + <string name="more_keys_for_i">î,ï,í,ī,ì</string> + <!-- U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX + U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS + U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE + U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE + U+0153: "œ" LATIN SMALL LIGATURE OE + U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE + U+014D: "ō" LATIN SMALL LETTER O WITH MACRON + U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE --> + <string name="more_keys_for_o">ô,ö,ò,ó,œ,ø,ō,õ</string> + <!-- U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX + U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS + U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE + U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE + U+016B: "ū" LATIN SMALL LETTER U WITH MACRON --> + <string name="more_keys_for_u">û,ü,ù,ú,ū</string> + <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S --> + <string name="more_keys_for_s">ß</string> + <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE --> + <string name="more_keys_for_n">ñ</string> + <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA --> + <string name="more_keys_for_c">ç</string> + <string name="more_keys_for_g">g\'</string> +</resources> diff --git a/tools/maketext/res/values-tl/donottranslate-more-keys.xml b/tools/maketext/res/values-tl/donottranslate-more-keys.xml new file mode 100644 index 000000000..383d55ccf --- /dev/null +++ b/tools/maketext/res/values-tl/donottranslate-more-keys.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE + U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE + U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS + U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX + U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE + U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE + U+0105: "ą" LATIN SMALL LETTER A WITH OGONEK + U+00E6: "æ" LATIN SMALL LETTER AE + U+0101: "ā" LATIN SMALL LETTER A WITH MACRON + U+00AA: "ª" FEMININE ORDINAL INDICATOR --> + <string name="more_keys_for_a">á,à,ä,â,ã,å,ą,æ,ā,ª</string> + <!-- U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE + U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE + U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS + U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX + U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK + U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE + U+0113: "ē" LATIN SMALL LETTER E WITH MACRON --> + <string name="more_keys_for_e">é,è,ë,ê,ę,ė,ē</string> + <!-- U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE + U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS + U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE + U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX + U+012F: "į" LATIN SMALL LETTER I WITH OGONEK + U+012B: "ī" LATIN SMALL LETTER I WITH MACRON --> + <string name="more_keys_for_i">í,ï,ì,î,į,ī</string> + <!-- U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE + U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE + U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS + U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX + U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE + U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE + U+0153: "œ" LATIN SMALL LIGATURE OE + U+014D: "ō" LATIN SMALL LETTER O WITH MACRON + U+00BA: "º" MASCULINE ORDINAL INDICATOR --> + <string name="more_keys_for_o">ó,ò,ö,ô,õ,ø,œ,ō,º</string> + <!-- U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE + U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS + U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE + U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX + U+016B: "ū" LATIN SMALL LETTER U WITH MACRON --> + <string name="more_keys_for_u">ú,ü,ù,û,ū</string> + <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE + U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE --> + <string name="more_keys_for_n">ñ,ń</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 --> + <string name="more_keys_for_c">ç,ć,č</string> +</resources> diff --git a/tools/maketext/res/values-uk/donottranslate-more-keys.xml b/tools/maketext/res/values-uk/donottranslate-more-keys.xml index 32397049a..6d4b5f9e1 100644 --- a/tools/maketext/res/values-uk/donottranslate-more-keys.xml +++ b/tools/maketext/res/values-uk/donottranslate-more-keys.xml @@ -20,12 +20,16 @@ <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- U+0449: "щ" CYRILLIC SMALL LETTER SHCHA --> <string name="keylabel_for_east_slavic_row1_9">щ</string> + <!-- U+0457: "ї" CYRILLIC SMALL LETTER YI --> + <string name="keylabel_for_east_slavic_row1_12">ї</string> <!-- U+0456: "і" CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I --> <string name="keylabel_for_east_slavic_row2_1">і</string> + <!-- U+0454: "є" CYRILLIC SMALL LETTER UKRAINIAN IE --> + <string name="keylabel_for_east_slavic_row2_11">є</string> <!-- U+0438: "и" CYRILLIC SMALL LETTER I --> <string name="keylabel_for_east_slavic_row3_5">и</string> - <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN --> - <string name="more_keys_for_cyrillic_ha">ъ</string> + <!-- U+0491: "ґ" CYRILLIC SMALL LETTER GHE WITH UPTURN --> + <string name="more_keys_for_cyrillic_ghe">ґ</string> <!-- U+0457: "ї" CYRILLIC SMALL LETTER YI --> <string name="more_keys_for_east_slavic_row2_1">ї</string> <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN --> diff --git a/tools/maketext/res/values-zu/donottranslate-more-keys.xml b/tools/maketext/res/values-zu/donottranslate-more-keys.xml new file mode 100644 index 000000000..191791530 --- /dev/null +++ b/tools/maketext/res/values-zu/donottranslate-more-keys.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- This is the same as English --> + <!-- 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+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS + U+00E6: "æ" LATIN SMALL LETTER AE + U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE + U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE + U+0101: "ā" LATIN SMALL LETTER A WITH MACRON --> + <string name="more_keys_for_a">à,á,â,ä,æ,ã,å,ā</string> + <!-- U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE + U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE + U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX + U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS + U+0113: "ē" LATIN SMALL LETTER E WITH MACRON --> + <string name="more_keys_for_e">è,é,ê,ë,ē</string> + <!-- U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX + U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS + U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE + U+012B: "ī" LATIN SMALL LETTER I WITH MACRON + U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE --> + <string name="more_keys_for_i">î,ï,í,ī,ì</string> + <!-- U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX + U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS + U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE + U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE + U+0153: "œ" LATIN SMALL LIGATURE OE + U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE + U+014D: "ō" LATIN SMALL LETTER O WITH MACRON + U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE --> + <string name="more_keys_for_o">ô,ö,ò,ó,œ,ø,ō,õ</string> + <!-- U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX + U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS + U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE + U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE + U+016B: "ū" LATIN SMALL LETTER U WITH MACRON --> + <string name="more_keys_for_u">û,ü,ù,ú,ū</string> + <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S --> + <string name="more_keys_for_s">ß</string> + <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE --> + <string name="more_keys_for_n">ñ</string> + <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA --> + <string name="more_keys_for_c">ç</string> +</resources> diff --git a/tools/maketext/res/values/donottranslate-more-keys.xml b/tools/maketext/res/values/donottranslate-more-keys.xml index 922b42d1b..4d7100b8c 100644 --- a/tools/maketext/res/values/donottranslate-more-keys.xml +++ b/tools/maketext/res/values/donottranslate-more-keys.xml @@ -44,12 +44,13 @@ <string name="more_keys_for_nordic_row2_10"></string> <string name="more_keys_for_nordic_row2_11"></string> <string name="keylabel_for_east_slavic_row1_9"></string> + <string name="keylabel_for_east_slavic_row1_12"></string> <string name="keylabel_for_east_slavic_row2_1"></string> + <string name="keylabel_for_east_slavic_row2_11"></string> <string name="keylabel_for_east_slavic_row3_5"></string> <string name="more_keys_for_cyrillic_u"></string> - <string name="more_keys_for_cyrillic_ye"></string> <string name="more_keys_for_cyrillic_en"></string> - <string name="more_keys_for_cyrillic_ha"></string> + <string name="more_keys_for_cyrillic_ghe"></string> <string name="more_keys_for_east_slavic_row2_1"></string> <string name="more_keys_for_cyrillic_o"></string> <string name="more_keys_for_cyrillic_soft_sign"></string> @@ -158,7 +159,6 @@ <string name="more_keys_for_symbols_0">ⁿ,∅</string> <string name="keylabel_for_comma">,</string> <string name="more_keys_for_comma"></string> - <string name="keylabel_for_symbols_exclamation">!</string> <string name="keylabel_for_symbols_question">\?</string> <string name="keylabel_for_symbols_semicolon">;</string> <string name="keylabel_for_symbols_percent">%</string> @@ -177,6 +177,14 @@ <string name="keylabel_for_apostrophe">\'</string> <string name="keyhintlabel_for_apostrophe">\"</string> <string name="more_keys_for_apostrophe">\"</string> + <string name="more_keys_for_q"></string> + <string name="more_keys_for_x"></string> + <string name="keylabel_for_q">q</string> + <string name="keylabel_for_w">w</string> + <string name="keylabel_for_y">y</string> + <string name="keylabel_for_x">x</string> + <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE --> + <string name="keylabel_for_spanish_row2_10">ñ</string> <string name="more_keys_for_am_pm">!fixedColumnOrder!2,!hasLabels!,\@string/label_time_am,\@string/label_time_pm</string> <string name="settings_as_more_key">!icon/settings_key|!code/key_settings</string> <string name="shortcut_as_more_key">!icon/shortcut_key|!code/key_shortcut</string> diff --git a/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java index 366d73e20..6d6bc0ea6 100644 --- a/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java +++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java @@ -26,15 +26,14 @@ import java.util.Enumeration; import java.util.jar.JarEntry; import java.util.jar.JarFile; -public class JarUtils { - private static final String MANIFEST = "META-INF/MANIFEST.MF"; - +public final class JarUtils { private JarUtils() { // This utility class is not publicly instantiable. } - public static JarFile getJarFile(final ClassLoader loader) { - final URL resUrl = loader.getResource(MANIFEST); + public static JarFile getJarFile(final Class<?> mainClass) { + final String mainClassPath = "/" + mainClass.getName().replace('.', '/') + ".class"; + final URL resUrl = mainClass.getResource(mainClassPath); if (!resUrl.getProtocol().equals("jar")) { throw new RuntimeException("Should run as jar"); } diff --git a/tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java index a5abcf1c1..4a9236962 100644 --- a/tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java +++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java @@ -58,7 +58,7 @@ public class LabelText { public static void main(final String[] args) { final Options options = new Options(args); - final JarFile jar = JarUtils.getJarFile(LabelText.class.getClassLoader()); + final JarFile jar = JarUtils.getJarFile(LabelText.class); final MoreKeysResources resources = new MoreKeysResources(jar); resources.writeToJava(options.mJava); } diff --git a/tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java index a4835932b..37ac0d006 100644 --- a/tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java +++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java @@ -100,7 +100,7 @@ public class MoreKeysResources { final File outputFile = new File(outPackage, JAVA_TEMPLATE.replace(".tmpl", ".java")); outPackage.mkdirs(); - ps = new PrintStream(outputFile); + ps = new PrintStream(outputFile, "UTF-8"); } lnr = new LineNumberReader(new InputStreamReader(JarUtils.openResource(template))); inflateTemplate(lnr, ps); |