aboutsummaryrefslogtreecommitdiffstats
path: root/tools/dicttool/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-10 23:08:29 +0900
committerJean Chalard <jchalard@google.com>2013-12-13 18:15:05 +0900
commit7b55cd3e2b4966150fa4c44dd43ebfeb77058a43 (patch)
tree1a5e2dbcc86543e4cd661763e6a057aff9b4da03 /tools/dicttool/src
parent2fa3693c264a4c150ac307d9bb7f6f8f18cc4ffc (diff)
downloadlatinime-7b55cd3e2b4966150fa4c44dd43ebfeb77058a43.tar.gz
latinime-7b55cd3e2b4966150fa4c44dd43ebfeb77058a43.tar.xz
latinime-7b55cd3e2b4966150fa4c44dd43ebfeb77058a43.zip
Remove flags from Java side.
This simplifies the code quite a bit. - GERMAN_UMLAUTS are now handled through a key-value attribute. The dictionary generator does not need to know about it any more. - FRENCH_LIGATURES are deprecated as we handle them with shortcuts now. - CONTAINS_BIGRAMS is deprecated. Bigram processing is always applied regardless of this flag. Bug: 11281748 Change-Id: If567e52e245a9342adc7f3104a0f7d8d782df8c1
Diffstat (limited to 'tools/dicttool/src')
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/CombinedInputOutput.java15
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java12
-rw-r--r--tools/dicttool/src/com/android/inputmethod/latin/dicttool/XmlDictInputOutput.java13
3 files changed, 3 insertions, 37 deletions
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/CombinedInputOutput.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/CombinedInputOutput.java
index 4b6716936..16f82dafd 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/CombinedInputOutput.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/CombinedInputOutput.java
@@ -50,8 +50,6 @@ public class CombinedInputOutput {
private static final String NOT_A_WORD_TAG = "not_a_word";
private static final String WHITELIST_TAG = "whitelist";
private static final String OPTIONS_TAG = "options";
- private static final String GERMAN_UMLAUT_PROCESSING_OPTION = "german_umlaut_processing";
- private static final String FRENCH_LIGATURE_PROCESSING_OPTION = "french_ligature_processing";
private static final String COMMENT_LINE_STARTER = "#";
/**
@@ -112,13 +110,9 @@ public class CombinedInputOutput {
attributes.put(keyValue[0], keyValue[1]);
}
- final boolean processUmlauts =
- GERMAN_UMLAUT_PROCESSING_OPTION.equals(attributes.get(OPTIONS_TAG));
- final boolean processLigatures =
- FRENCH_LIGATURE_PROCESSING_OPTION.equals(attributes.get(OPTIONS_TAG));
attributes.remove(OPTIONS_TAG);
- final FusionDictionary dict = new FusionDictionary(new PtNodeArray(), new DictionaryOptions(
- attributes, processUmlauts, processLigatures));
+ final FusionDictionary dict =
+ new FusionDictionary(new PtNodeArray(), new DictionaryOptions(attributes));
String line;
String word = null;
@@ -216,11 +210,6 @@ public class CombinedInputOutput {
destination.write(options.get(DICTIONARY_TAG));
options.remove(DICTIONARY_TAG);
}
- if (dict.mOptions.mGermanUmlautProcessing) {
- destination.write("," + OPTIONS_TAG + "=" + GERMAN_UMLAUT_PROCESSING_OPTION);
- } else if (dict.mOptions.mFrenchLigatureProcessing) {
- destination.write("," + OPTIONS_TAG + "=" + FRENCH_LIGATURE_PROCESSING_OPTION);
- }
for (final String key : dict.mOptions.mAttributes.keySet()) {
final String value = dict.mOptions.mAttributes.get(key);
destination.write("," + key + "=" + value);
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java
index 66fd084cd..7ac3c67a1 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Diff.java
@@ -85,18 +85,6 @@ public class Diff extends Dicttool.Command {
private static void diffHeaders(final FusionDictionary dict0, final FusionDictionary dict1) {
boolean hasDifferences = false;
- if (dict0.mOptions.mFrenchLigatureProcessing != dict1.mOptions.mFrenchLigatureProcessing) {
- System.out.println(" French ligature processing : "
- + dict0.mOptions.mFrenchLigatureProcessing + " <=> "
- + dict1.mOptions.mFrenchLigatureProcessing);
- hasDifferences = true;
- }
- else if (dict0.mOptions.mGermanUmlautProcessing != dict1.mOptions.mGermanUmlautProcessing) {
- System.out.println(" German umlaut processing : "
- + dict0.mOptions.mGermanUmlautProcessing + " <=> "
- + dict1.mOptions.mGermanUmlautProcessing);
- hasDifferences = true;
- }
final HashMap<String, String> options1 =
new HashMap<String, String>(dict1.mOptions.mAttributes);
for (final String optionKey : dict0.mOptions.mAttributes.keySet()) {
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/XmlDictInputOutput.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/XmlDictInputOutput.java
index 4e99bf979..d226251c1 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/XmlDictInputOutput.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/XmlDictInputOutput.java
@@ -57,8 +57,6 @@ public class XmlDictInputOutput {
private static final String NOT_A_WORD_ATTR = "not_a_word";
private static final String OPTIONS_KEY = "options";
- private static final String GERMAN_UMLAUT_PROCESSING_OPTION = "german_umlaut_processing";
- private static final String FRENCH_LIGATURE_PROCESSING_OPTION = "french_ligature_processing";
/**
* SAX handler for a unigram XML file.
@@ -120,12 +118,8 @@ public class XmlDictInputOutput {
attributes.put(attrName, attrs.getValue(attrIndex));
}
final String optionsString = attributes.get(OPTIONS_KEY);
- final boolean processUmlauts =
- GERMAN_UMLAUT_PROCESSING_OPTION.equals(optionsString);
- final boolean processLigatures =
- FRENCH_LIGATURE_PROCESSING_OPTION.equals(optionsString);
mDictionary = new FusionDictionary(new PtNodeArray(),
- new DictionaryOptions(attributes, processUmlauts, processLigatures));
+ new DictionaryOptions(attributes));
} else {
mState = UNKNOWN;
}
@@ -361,11 +355,6 @@ public class XmlDictInputOutput {
// TODO: use an XMLSerializer if this gets big
destination.write("<wordlist format=\"2\"");
final HashMap<String, String> options = dict.mOptions.mAttributes;
- if (dict.mOptions.mGermanUmlautProcessing) {
- destination.write(" " + OPTIONS_KEY + "=\"" + GERMAN_UMLAUT_PROCESSING_OPTION + "\"");
- } else if (dict.mOptions.mFrenchLigatureProcessing) {
- destination.write(" " + OPTIONS_KEY + "=\"" + FRENCH_LIGATURE_PROCESSING_OPTION + "\"");
- }
for (final String key : dict.mOptions.mAttributes.keySet()) {
final String value = dict.mOptions.mAttributes.get(key);
destination.write(" " + key + "=\"" + value + "\"");