aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/makedict/src/com/android/inputmethod/latin/XmlDictInputOutput.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/makedict/src/com/android/inputmethod/latin/XmlDictInputOutput.java b/tools/makedict/src/com/android/inputmethod/latin/XmlDictInputOutput.java
index 838cda535..4720e9d10 100644
--- a/tools/makedict/src/com/android/inputmethod/latin/XmlDictInputOutput.java
+++ b/tools/makedict/src/com/android/inputmethod/latin/XmlDictInputOutput.java
@@ -181,6 +181,26 @@ public class XmlDictInputOutput {
}
/**
+ * SAX handler for a shortcut XML file.
+ */
+ static private class ShortcutHandler 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";
+
+ public ShortcutHandler() {
+ super(ENTRY_TAG, ENTRY_ATTRIBUTE, TARGET_TAG, REPLACEMENT_ATTRIBUTE,
+ TARGET_PRIORITY_ATTRIBUTE);
+ }
+
+ public HashMap<String, ArrayList<WeightedString>> getShortcutMap() {
+ return getAssocMap();
+ }
+ }
+
+ /**
* Reads a dictionary from an XML file.
*
* This is the public method that will parse an XML file and return the corresponding memory