aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/dicttool/Android.mk (renamed from tools/makedict/Android.mk)8
-rw-r--r--tools/dicttool/etc/Android.mk (renamed from tools/makedict/etc/Android.mk)4
-rwxr-xr-xtools/dicttool/etc/dicttool_aosp (renamed from tools/makedict/etc/makedict)5
-rwxr-xr-xtools/dicttool/etc/makedict_aosp18
-rw-r--r--tools/dicttool/etc/manifest.txt1
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/AdditionalCommandList.java22
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/CommandList.java26
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/Compress.java98
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/DictionaryMaker.java (renamed from tools/makedict/src/com/android/inputmethod/latin/makedict/DictionaryMaker.java)41
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/Dicttool.java94
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/Info.java36
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/Makedict.java40
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/MakedictLog.java (renamed from tools/makedict/src/com/android/inputmethod/latin/makedict/MakedictLog.java)0
-rw-r--r--tools/dicttool/src/android/inputmethod/latin/dicttool/XmlDictInputOutput.java (renamed from tools/makedict/src/com/android/inputmethod/latin/makedict/XmlDictInputOutput.java)53
-rw-r--r--tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictInputOutputTest.java (renamed from tools/makedict/tests/com/android/inputmethod/latin/BinaryDictInputOutputTest.java)0
-rwxr-xr-xtools/dicttool/tests/etc/test-dicttool.sh16
-rw-r--r--tools/makedict/etc/manifest.txt1
-rw-r--r--tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl9
-rw-r--r--tools/maketext/res/values-af/donottranslate-more-keys.xml69
-rw-r--r--tools/maketext/res/values-be/donottranslate-more-keys.xml8
-rw-r--r--tools/maketext/res/values-es/donottranslate-more-keys.xml12
-rw-r--r--tools/maketext/res/values-ky/donottranslate-more-keys.xml8
-rw-r--r--tools/maketext/res/values-ru/donottranslate-more-keys.xml8
-rw-r--r--tools/maketext/res/values-sr/donottranslate-more-keys.xml19
-rw-r--r--tools/maketext/res/values-sw/donottranslate-more-keys.xml65
-rw-r--r--tools/maketext/res/values-tl/donottranslate-more-keys.xml70
-rw-r--r--tools/maketext/res/values-uk/donottranslate-more-keys.xml8
-rw-r--r--tools/maketext/res/values-zu/donottranslate-more-keys.xml64
-rw-r--r--tools/maketext/res/values/donottranslate-more-keys.xml6
-rw-r--r--tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java7
-rw-r--r--tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java2
-rw-r--r--tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java2
32 files changed, 758 insertions, 62 deletions
diff --git a/tools/makedict/Android.mk b/tools/dicttool/Android.mk
index 7b5dee2ce..b0b47af00 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.
@@ -21,10 +21,10 @@ MAKEDICT_CORE_SOURCE_DIRECTORY := ../../java/src/com/android/inputmethod/latin/m
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)
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..fbfc1dabb 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,12 @@
* 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.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 +27,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;
@@ -102,8 +108,12 @@ public class DictionaryMaker {
}
private void displayHelp() {
- MakedictLog.i("Usage: makedict "
- + "[-s <unigrams.xml> [-b <bigrams.xml>] [-c <shortcuts.xml>] "
+ 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 format version 2>] "
+ "[-d1 <binary output format version 1>] [-x <xml output>] [-2]\n"
+ "\n"
@@ -114,7 +124,7 @@ public class DictionaryMaker {
+ " 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 {
@@ -229,15 +239,30 @@ 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(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
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..9ce8c4934 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;
@@ -88,6 +90,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));
+ }
mDictionary = null;
mShortcutsMap.clear();
mWord = "";
@@ -177,7 +183,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 +192,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 +224,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 +269,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 +282,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 +307,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 +318,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.
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..24042f120 100644
--- a/tools/makedict/tests/com/android/inputmethod/latin/BinaryDictInputOutputTest.java
+++ b/tools/dicttool/tests/com/android/inputmethod/latin/makedict/BinaryDictInputOutputTest.java
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">&#x00E1;,&#x00E2;,&#x00E4;,&#x00E0;,&#x00E6;,&#x00E3;,&#x00E5;,&#x0101;</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">&#x00E9;,&#x00E8;,&#x00EA;,&#x00EB;,&#x0119;,&#x0117;,&#x0113;</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">&#x00ED;,&#x00EC;,&#x00EF;,&#x00EE;,&#x012F;,&#x012B;,&#x0133;</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">&#x00F3;,&#x00F4;,&#x00F6;,&#x00F2;,&#x00F5;,&#x0153;,&#x00F8;,&#x014D;</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">&#x00FA;,&#x00FB;,&#x00FC;,&#x00F9;,&#x016B;</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
+ U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE -->
+ <string name="more_keys_for_n">&#x00F1;,&#x0144;</string>
+ <string name="more_keys_for_y">&#x00FD;,&#x0177;,&#x00FF;,&#x0133;</string>
+ <!-- U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE
+ U+0133: "ij" LATIN SMALL LIGATURE IJ -->
+ <string name="more_keys_for_y">&#x00FD;,&#x0133;</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">&#x045E;</string>
+ <!-- U+0451: "ё" CYRILLIC SMALL LETTER IO -->
+ <string name="keylabel_for_east_slavic_row1_12">&#x0451;</string>
<!-- U+044B: "ы" CYRILLIC SMALL LETTER YERU -->
<string name="keylabel_for_east_slavic_row2_1">&#x044B;</string>
+ <!-- U+044D: "э" CYRILLIC SMALL LETTER E -->
+ <string name="keylabel_for_east_slavic_row2_11">&#x044D;</string>
<!-- U+0456: "і" CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -->
<string name="keylabel_for_east_slavic_row3_5">&#x0456;</string>
- <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
- <string name="more_keys_for_cyrillic_ha">&#x044A;</string>
+ <!-- U+0451: "ё" CYRILLIC SMALL LETTER IO -->
+ <string name="more_keys_for_cyrillic_ie">&#x0451;</string>
<!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
<string name="more_keys_for_cyrillic_soft_sign">&#x044A;</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">&#x00E7;,&#x0107;,&#x010D;</string>
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK
U+00BF: "¿" INVERTED QUESTION MARK -->
- <string name="more_keys_for_punctuation">"!fixedColumnOrder!9,\",\',#,-,&#x00A1;,!,&#x00BF;,\\,,\?,\@,&amp;,\\%,+,;,:,/,(,)"</string>
- <string name="keyhintlabel_for_tablet_comma">&#x00A1;</string>
- <string name="more_keys_for_tablet_comma">"&#x00A1;,!"</string>
- <string name="keyhintlabel_for_tablet_period">&#x00BF;</string>
- <string name="more_keys_for_tablet_period">"&#x00BF;,\?"</string>
+ <string name="more_keys_for_punctuation">"!fixedColumnOrder!9,&#x00A1;,\",\',#,-,:,!,\\,,\?,&#x00BF;,\@,&amp;,\\%,+,;,/,(,)"</string>
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK -->
- <string name="keylabel_for_symbols_exclamation">"&#x00A1;"</string>
+ <string name="more_keys_for_tablet_comma">"!,&#x00A1;"</string>
<!-- U+00BF: "¿" INVERTED QUESTION MARK -->
- <string name="keylabel_for_symbols_question">"&#x00BF;"</string>
- <string name="more_keys_for_symbols_exclamation">"!"</string>
- <string name="more_keys_for_symbols_question">"\?"</string>
+ <string name="more_keys_for_tablet_period">"\?,&#x00BF;"</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">&#x0449;</string>
+ <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
+ <string name="keylabel_for_east_slavic_row1_12">&#x044A;</string>
<!-- U+044B: "ы" CYRILLIC SMALL LETTER YERU -->
<string name="keylabel_for_east_slavic_row2_1">&#x044B;</string>
+ <!-- U+044D: "э" CYRILLIC SMALL LETTER E -->
+ <string name="keylabel_for_east_slavic_row2_11">&#x044D;</string>
<!-- U+0438: "и" CYRILLIC SMALL LETTER I -->
<string name="keylabel_for_east_slavic_row3_5">&#x0438;</string>
<!-- U+04AF: "ү" CYRILLIC SMALL LETTER STRAIGHT U -->
<string name="more_keys_for_cyrillic_u">&#x04AF;</string>
+ <!-- U+0451: "ё" CYRILLIC SMALL LETTER IO -->
+ <string name="more_keys_for_cyrillic_ie">&#x0451;</string>
<!-- U+04A3: "ң" CYRILLIC SMALL LETTER EN WITH DESCENDER -->
<string name="more_keys_for_cyrillic_en">&#x04A3;</string>
- <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
- <string name="more_keys_for_cyrillic_ha">&#x044A;</string>
<!-- U+04E9: "ө" CYRILLIC SMALL LETTER BARRED O -->
<string name="more_keys_for_cyrillic_o">&#x04E9;</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">&#x0449;</string>
+ <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
+ <string name="keylabel_for_east_slavic_row1_12">&#x044A;</string>
<!-- U+044B: "ы" CYRILLIC SMALL LETTER YERU -->
<string name="keylabel_for_east_slavic_row2_1">&#x044B;</string>
+ <!-- U+044D: "э" CYRILLIC SMALL LETTER E -->
+ <string name="keylabel_for_east_slavic_row2_11">&#x044D;</string>
<!-- U+0438: "и" CYRILLIC SMALL LETTER I -->
<string name="keylabel_for_east_slavic_row3_5">&#x0438;</string>
<!-- U+0451: "ё" CYRILLIC SMALL LETTER IO -->
- <string name="more_keys_for_cyrillic_ye">&#x0451;</string>
- <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
- <string name="more_keys_for_cyrillic_ha">&#x044A;</string>
+ <string name="more_keys_for_cyrillic_ie">&#x0451;</string>
<!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
<string name="more_keys_for_cyrillic_soft_sign">&#x044A;</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">&#x0161;,&#x00DF;,&#x015B;</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">&#x010D;,&#x00E7;,&#x0107;</string>
+ U+010F: "ď" LATIN SMALL LETTER D WITH CARON
+ <string name="more_keys_for_d">&#x010F;</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">&#x017E;,&#x017A;,&#x017C;</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">&#x0437;</string>
<!-- U+045B: "ћ" CYRILLIC SMALL LETTER TSHE -->
@@ -30,6 +48,7 @@
<string name="more_keys_for_cyrillic_ie">&#x0450;</string>
<!-- U+045D: "ѝ" CYRILLIC SMALL LETTER I WITH GRAVE -->
<string name="more_keys_for_cyrillic_i">&#x045D;</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">&#x00E0;,&#x00E1;,&#x00E2;,&#x00E4;,&#x00E6;,&#x00E3;,&#x00E5;,&#x0101;</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">&#x00E8;,&#x00E9;,&#x00EA;,&#x00EB;,&#x0113;</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">&#x00EE;,&#x00EF;,&#x00ED;,&#x012B;,&#x00EC;</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">&#x00F4;,&#x00F6;,&#x00F2;,&#x00F3;,&#x0153;,&#x00F8;,&#x014D;,&#x00F5;</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">&#x00FB;,&#x00FC;,&#x00F9;,&#x00FA;,&#x016B;</string>
+ <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S -->
+ <string name="more_keys_for_s">&#x00DF;</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE -->
+ <string name="more_keys_for_n">&#x00F1;</string>
+ <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA -->
+ <string name="more_keys_for_c">&#x00E7;</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">&#x00E1;,&#x00E0;,&#x00E4;,&#x00E2;,&#x00E3;,&#x00E5;,&#x0105;,&#x00E6;,&#x0101;,&#x00AA;</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">&#x00E9;,&#x00E8;,&#x00EB;,&#x00EA;,&#x0119;,&#x0117;,&#x0113;</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">&#x00ED;,&#x00EF;,&#x00EC;,&#x00EE;,&#x012F;,&#x012B;</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">&#x00F3;,&#x00F2;,&#x00F6;,&#x00F4;,&#x00F5;,&#x00F8;,&#x0153;,&#x014D;,&#x00BA;</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">&#x00FA;,&#x00FC;,&#x00F9;,&#x00FB;,&#x016B;</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
+ U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE -->
+ <string name="more_keys_for_n">&#x00F1;,&#x0144;</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">&#x00E7;,&#x0107;,&#x010D;</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">&#x0449;</string>
+ <!-- U+0457: "ї" CYRILLIC SMALL LETTER YI -->
+ <string name="keylabel_for_east_slavic_row1_12">&#x0457;</string>
<!-- U+0456: "і" CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -->
<string name="keylabel_for_east_slavic_row2_1">&#x0456;</string>
+ <!-- U+0454: "є" CYRILLIC SMALL LETTER UKRAINIAN IE -->
+ <string name="keylabel_for_east_slavic_row2_11">&#x0454;</string>
<!-- U+0438: "и" CYRILLIC SMALL LETTER I -->
<string name="keylabel_for_east_slavic_row3_5">&#x0438;</string>
- <!-- U+044A: "ъ" CYRILLIC SMALL LETTER HARD SIGN -->
- <string name="more_keys_for_cyrillic_ha">&#x044A;</string>
+ <!-- U+0491: "ґ" CYRILLIC SMALL LETTER GHE WITH UPTURN -->
+ <string name="more_keys_for_cyrillic_ghe">&#x0491;</string>
<!-- U+0457: "ї" CYRILLIC SMALL LETTER YI -->
<string name="more_keys_for_east_slavic_row2_1">&#x0457;</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">&#x00E0;,&#x00E1;,&#x00E2;,&#x00E4;,&#x00E6;,&#x00E3;,&#x00E5;,&#x0101;</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">&#x00E8;,&#x00E9;,&#x00EA;,&#x00EB;,&#x0113;</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">&#x00EE;,&#x00EF;,&#x00ED;,&#x012B;,&#x00EC;</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">&#x00F4;,&#x00F6;,&#x00F2;,&#x00F3;,&#x0153;,&#x00F8;,&#x014D;,&#x00F5;</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">&#x00FB;,&#x00FC;,&#x00F9;,&#x00FA;,&#x016B;</string>
+ <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S -->
+ <string name="more_keys_for_s">&#x00DF;</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE -->
+ <string name="more_keys_for_n">&#x00F1;</string>
+ <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA -->
+ <string name="more_keys_for_c">&#x00E7;</string>
+</resources>
diff --git a/tools/maketext/res/values/donottranslate-more-keys.xml b/tools/maketext/res/values/donottranslate-more-keys.xml
index 922b42d1b..543e93620 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">&#x207F;,&#x2205;</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>
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..07a6c300e 100644
--- a/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java
+++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java
@@ -27,14 +27,13 @@ import java.util.jar.JarEntry;
import java.util.jar.JarFile;
public class JarUtils {
- private static final String MANIFEST = "META-INF/MANIFEST.MF";
-
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);