Parse the shortcuts list file. (B2)

This does not use the shortcuts yet, it only reads up the file
in memory.

Change-Id: Ib9b8594c2dd6a38b1209b01c80e8894696312998
main
Jean Chalard 2011-12-26 18:20:06 +09:00
parent 07af2249bb
commit 3b161b2526
1 changed files with 20 additions and 0 deletions

View File

@ -180,6 +180,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. * Reads a dictionary from an XML file.
* *