diff options
Diffstat (limited to 'java/src')
5 files changed, 93 insertions, 100 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java index cace069c4..387ed3945 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java @@ -101,10 +101,10 @@ public final class KeyboardTextsTable { /* 19: 9 */ "keylabel_for_currency", /* 20: 8 */ "more_keys_for_r", /* 21: 6 */ "more_keys_for_k", - /* 22: 6 */ "keylabel_for_nordic_row1_11", - /* 23: 6 */ "keylabel_for_nordic_row2_10", - /* 24: 6 */ "keylabel_for_nordic_row2_11", - /* 25: 6 */ "more_keys_for_cyrillic_ie", + /* 22: 6 */ "more_keys_for_cyrillic_ie", + /* 23: 5 */ "keylabel_for_nordic_row1_11", + /* 24: 5 */ "keylabel_for_nordic_row2_10", + /* 25: 5 */ "keylabel_for_nordic_row2_11", /* 26: 5 */ "more_keys_for_nordic_row2_10", /* 27: 5 */ "keylabel_for_east_slavic_row1_9", /* 28: 5 */ "keylabel_for_east_slavic_row2_2", @@ -714,11 +714,13 @@ public final class KeyboardTextsTable { // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, null, null, - /* ~ keylabel_for_nordic_row2_11 */ + null, null, null, null, null, null, null, null, null, null, null, + /* ~ more_keys_for_k */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* more_keys_for_cyrillic_ie */ "\u0451", - /* more_keys_for_nordic_row2_10 */ null, + /* keylabel_for_nordic_row1_11 ~ */ + null, null, null, null, + /* ~ more_keys_for_nordic_row2_10 */ // U+045E: "ў" CYRILLIC SMALL LETTER SHORT U /* keylabel_for_east_slavic_row1_9 */ "\u045E", // U+044B: "ы" CYRILLIC SMALL LETTER YERU @@ -959,15 +961,14 @@ public final class KeyboardTextsTable { /* single_angle_quotes */ "!text/single_raqm_laqm", /* double_angle_quotes */ "!text/double_raqm_laqm", /* keylabel_for_currency ~ */ - null, null, null, - /* ~ more_keys_for_k */ + null, null, null, null, + /* ~ more_keys_for_cyrillic_ie */ // U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE /* keylabel_for_nordic_row1_11 */ "\u00E5", // U+00E6: "æ" LATIN SMALL LETTER AE /* keylabel_for_nordic_row2_10 */ "\u00E6", // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE /* keylabel_for_nordic_row2_11 */ "\u00F8", - /* more_keys_for_cyrillic_ie */ null, // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS /* more_keys_for_nordic_row2_10 */ "\u00E4", /* keylabel_for_east_slavic_row1_9 ~ */ @@ -1220,7 +1221,7 @@ public final class KeyboardTextsTable { // U+0137: "ķ" LATIN SMALL LETTER K WITH CEDILLA // U+0138: "ĸ" LATIN SMALL LETTER KRA /* more_keys_for_k */ "\u0137,\u0138", - /* keylabel_for_nordic_row1_11 ~ */ + /* more_keys_for_cyrillic_ie ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, @@ -1382,8 +1383,7 @@ public final class KeyboardTextsTable { // U+0146: "ņ" LATIN SMALL LETTER N WITH CEDILLA // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE - // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE - /* more_keys_for_n */ "\u0146,\u00F1,\u0144,\u0144", + /* more_keys_for_n */ "\u0146,\u00F1,\u0144", /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS @@ -1414,13 +1414,13 @@ public final class KeyboardTextsTable { /* more_keys_for_r */ "\u0157,\u0159,\u0155", // U+0137: "ķ" LATIN SMALL LETTER K WITH CEDILLA /* more_keys_for_k */ "\u0137", + /* more_keys_for_cyrillic_ie */ null, // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS /* keylabel_for_nordic_row1_11 */ "\u00FC", // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS /* keylabel_for_nordic_row2_10 */ "\u00F6", // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS /* keylabel_for_nordic_row2_11 */ "\u00E4", - /* more_keys_for_cyrillic_ie */ null, // U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE /* more_keys_for_nordic_row2_10 */ "\u00F5", }; @@ -1605,15 +1605,14 @@ public final class KeyboardTextsTable { // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE /* more_keys_for_z */ "\u017E,\u017A,\u017C", /* more_keys_for_t ~ */ - null, null, null, null, null, null, null, null, - /* ~ more_keys_for_k */ + null, null, null, null, null, null, null, null, null, + /* ~ more_keys_for_cyrillic_ie */ // U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE /* keylabel_for_nordic_row1_11 */ "\u00E5", // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS /* keylabel_for_nordic_row2_10 */ "\u00F6", // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS /* keylabel_for_nordic_row2_11 */ "\u00E4", - /* more_keys_for_cyrillic_ie */ null, // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE /* more_keys_for_nordic_row2_10 */ "\u00F8", /* keylabel_for_east_slavic_row1_9 ~ */ @@ -1943,15 +1942,6 @@ public final class KeyboardTextsTable { /* more_keys_for_z */ null, // U+00FE: "þ" LATIN SMALL LETTER THORN /* more_keys_for_t */ "\u00FE", - /* more_keys_for_l ~ */ - null, null, null, null, null, null, null, - /* ~ more_keys_for_k */ - // U+00F0: "ð" LATIN SMALL LETTER ETH - /* keylabel_for_nordic_row1_11 */ "\u00F0", - // U+00E6: "æ" LATIN SMALL LETTER AE - /* keylabel_for_nordic_row2_10 */ "\u00E6", - // U+00FE: "þ" LATIN SMALL LETTER THORN - /* keylabel_for_nordic_row2_11 */ "\u00FE", }; /* Language it: Italian */ @@ -2086,11 +2076,13 @@ public final class KeyboardTextsTable { // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, null, null, - /* ~ keylabel_for_nordic_row2_11 */ + null, null, null, null, null, null, null, null, null, null, null, + /* ~ more_keys_for_k */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* more_keys_for_cyrillic_ie */ "\u0451", - /* more_keys_for_nordic_row2_10 */ null, + /* keylabel_for_nordic_row1_11 ~ */ + null, null, null, null, + /* ~ more_keys_for_nordic_row2_10 */ // U+0449: "щ" CYRILLIC SMALL LETTER SHCHA /* keylabel_for_east_slavic_row1_9 */ "\u0449", // U+044B: "ы" CYRILLIC SMALL LETTER YERU @@ -2163,11 +2155,13 @@ public final class KeyboardTextsTable { // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, null, null, - /* ~ keylabel_for_nordic_row2_11 */ + null, null, null, null, null, null, null, null, null, null, null, + /* ~ more_keys_for_k */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* more_keys_for_cyrillic_ie */ "\u0451", - /* more_keys_for_nordic_row2_10 */ null, + /* keylabel_for_nordic_row1_11 ~ */ + null, null, null, null, + /* ~ more_keys_for_nordic_row2_10 */ // U+0449: "щ" CYRILLIC SMALL LETTER SHCHA /* keylabel_for_east_slavic_row1_9 */ "\u0449", // U+044B: "ы" CYRILLIC SMALL LETTER YERU @@ -2272,8 +2266,7 @@ public final class KeyboardTextsTable { // U+0146: "ņ" LATIN SMALL LETTER N WITH CEDILLA // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE - // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE - /* more_keys_for_n */ "\u0146,\u00F1,\u0144,\u0144", + /* more_keys_for_n */ "\u0146,\u00F1,\u0144", /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS @@ -2367,8 +2360,7 @@ public final class KeyboardTextsTable { // U+0146: "ņ" LATIN SMALL LETTER N WITH CEDILLA // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE - // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE - /* more_keys_for_n */ "\u0146,\u00F1,\u0144,\u0144", + /* more_keys_for_n */ "\u0146,\u00F1,\u0144", /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS @@ -2417,15 +2409,15 @@ public final class KeyboardTextsTable { // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, null, null, - /* ~ keylabel_for_nordic_row2_11 */ + null, null, null, null, null, null, null, null, null, null, null, + /* ~ more_keys_for_k */ // U+0450: "ѐ" CYRILLIC SMALL LETTER IE WITH GRAVE /* more_keys_for_cyrillic_ie */ "\u0450", - /* more_keys_for_nordic_row2_10 ~ */ + /* keylabel_for_nordic_row1_11 ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, /* ~ more_keys_for_cyrillic_o */ // U+0455: "ѕ" CYRILLIC SMALL LETTER DZE /* keylabel_for_south_slavic_row1_6 */ "\u0455", @@ -2492,14 +2484,14 @@ public final class KeyboardTextsTable { /* single_quotes */ "!text/single_9qm_rqm", /* more_keys_for_c ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_k */ + null, + /* ~ more_keys_for_cyrillic_ie */ // U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE /* keylabel_for_nordic_row1_11 */ "\u00E5", // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE /* keylabel_for_nordic_row2_10 */ "\u00F8", // U+00E6: "æ" LATIN SMALL LETTER AE /* keylabel_for_nordic_row2_11 */ "\u00E6", - /* more_keys_for_cyrillic_ie */ null, // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS /* more_keys_for_nordic_row2_10 */ "\u00F6", /* keylabel_for_east_slavic_row1_9 ~ */ @@ -2790,11 +2782,13 @@ public final class KeyboardTextsTable { // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, null, null, - /* ~ keylabel_for_nordic_row2_11 */ + null, null, null, null, null, null, null, null, null, null, null, + /* ~ more_keys_for_k */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* more_keys_for_cyrillic_ie */ "\u0451", - /* more_keys_for_nordic_row2_10 */ null, + /* keylabel_for_nordic_row1_11 ~ */ + null, null, null, null, + /* ~ more_keys_for_nordic_row2_10 */ // U+0449: "щ" CYRILLIC SMALL LETTER SHCHA /* keylabel_for_east_slavic_row1_9 */ "\u0449", // U+044B: "ы" CYRILLIC SMALL LETTER YERU @@ -2869,8 +2863,7 @@ public final class KeyboardTextsTable { // U+0146: "ņ" LATIN SMALL LETTER N WITH CEDILLA // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE - // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE - /* more_keys_for_n */ "\u0148,\u0146,\u00F1,\u0144,\u0144", + /* more_keys_for_n */ "\u0148,\u0146,\u00F1,\u0144", /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS @@ -2951,15 +2944,15 @@ public final class KeyboardTextsTable { /* single_angle_quotes */ "!text/single_raqm_laqm", /* double_angle_quotes */ "!text/double_raqm_laqm", /* keylabel_for_currency ~ */ - null, null, null, null, null, null, - /* ~ keylabel_for_nordic_row2_11 */ + null, null, null, + /* ~ more_keys_for_k */ // U+0450: "ѐ" CYRILLIC SMALL LETTER IE WITH GRAVE /* more_keys_for_cyrillic_ie */ "\u0450", - /* more_keys_for_nordic_row2_10 ~ */ + /* keylabel_for_nordic_row1_11 ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, /* ~ more_keys_for_cyrillic_o */ // TODO: Move these to sr-Latn once we can handle IETF language tag with script name specified. // BEGIN: More keys definitions for Serbian (Latin) @@ -3040,8 +3033,7 @@ public final class KeyboardTextsTable { /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS - // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS - /* more_keys_for_y */ "\u00FD,\u00FF,\u00FC", + /* more_keys_for_y */ "\u00FD,\u00FF", // U+00F0: "ð" LATIN SMALL LETTER ETH // U+010F: "ď" LATIN SMALL LETTER D WITH CARON /* more_keys_for_d */ "\u00F0,\u010F", @@ -3061,13 +3053,13 @@ public final class KeyboardTextsTable { // U+0159: "ř" LATIN SMALL LETTER R WITH CARON /* more_keys_for_r */ "\u0159", /* more_keys_for_k */ null, + /* more_keys_for_cyrillic_ie */ null, // U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE /* keylabel_for_nordic_row1_11 */ "\u00E5", // U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS /* keylabel_for_nordic_row2_10 */ "\u00F6", // U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS /* keylabel_for_nordic_row2_11 */ "\u00E4", - /* more_keys_for_cyrillic_ie */ null, // U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE // U+0153: "œ" LATIN SMALL LIGATURE OE /* more_keys_for_nordic_row2_10 */ "\u00F8,\u0153", @@ -3443,7 +3435,7 @@ public final class KeyboardTextsTable { // U+0103: "ă" LATIN SMALL LETTER A WITH BREVE // U+0105: "ą" LATIN SMALL LETTER A WITH OGONEK // U+00AA: "ª" FEMININE ORDINAL INDICATOR - /* more_keys_for_a */ "\u00E0,\u00E1,\u00E2,\u00E3,\u00E4,\u00E5,\u00E6,\u00E3,\u00E5,\u0101,\u0103,\u0105,\u00AA", + /* more_keys_for_a */ "\u00E0,\u00E1,\u00E2,\u00E3,\u00E4,\u00E5,\u00E6,\u0101,\u0103,\u0105,\u00AA", // U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE // U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE // U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX @@ -3550,7 +3542,7 @@ public final class KeyboardTextsTable { // U+0137: "ķ" LATIN SMALL LETTER K WITH CEDILLA // U+0138: "ĸ" LATIN SMALL LETTER KRA /* more_keys_for_k */ "\u0137,\u0138", - /* keylabel_for_nordic_row1_11 ~ */ + /* more_keys_for_cyrillic_ie ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, @@ -3595,7 +3587,7 @@ public final class KeyboardTextsTable { "hr", LANGUAGE_hr, /* 9/ 19 Croatian */ "hu", LANGUAGE_hu, /* 9/ 19 Hungarian */ "hy", LANGUAGE_hy_AM, /* 8/122 Armenian (Armenia) */ - "is", LANGUAGE_is, /* 13/ 25 Icelandic */ + "is", LANGUAGE_is, /* 10/ 15 Icelandic */ "it", LANGUAGE_it, /* 5/ 5 Italian */ "iw", LANGUAGE_iw, /* 20/117 Hebrew */ "ka", LANGUAGE_ka_GE, /* 3/ 11 Georgian (Georgia) */ diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index f659b3f79..544fd0319 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -25,7 +25,7 @@ import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.makedict.DictionaryHeader; import com.android.inputmethod.latin.makedict.FormatSpec; -import com.android.inputmethod.latin.makedict.FusionDictionary.DictionaryOptions; +import com.android.inputmethod.latin.makedict.FormatSpec.DictionaryOptions; import com.android.inputmethod.latin.makedict.UnsupportedFormatException; import com.android.inputmethod.latin.makedict.WordProperty; import com.android.inputmethod.latin.personalization.PersonalizationHelper; diff --git a/java/src/com/android/inputmethod/latin/makedict/DictionaryHeader.java b/java/src/com/android/inputmethod/latin/makedict/DictionaryHeader.java index b32eb9195..df447fd75 100644 --- a/java/src/com/android/inputmethod/latin/makedict/DictionaryHeader.java +++ b/java/src/com/android/inputmethod/latin/makedict/DictionaryHeader.java @@ -16,8 +16,8 @@ package com.android.inputmethod.latin.makedict; +import com.android.inputmethod.latin.makedict.FormatSpec.DictionaryOptions; import com.android.inputmethod.latin.makedict.FormatSpec.FormatOptions; -import com.android.inputmethod.latin.makedict.FusionDictionary.DictionaryOptions; /** * Class representing dictionary header. diff --git a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java index 484bb4b23..07217e48e 100644 --- a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java +++ b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java @@ -21,6 +21,8 @@ import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.makedict.DictDecoder.DictionaryBufferFactory; import java.io.File; +import java.util.Date; +import java.util.HashMap; /** * Dictionary File Format Specification. @@ -323,6 +325,45 @@ public final class FormatSpec { } /** + * Options global to the dictionary. + */ + public static final class DictionaryOptions { + public final HashMap<String, String> mAttributes; + public DictionaryOptions(final HashMap<String, String> attributes) { + mAttributes = attributes; + } + @Override + public String toString() { // Convenience method + return toString(0, false); + } + public String toString(final int indentCount, final boolean plumbing) { + final StringBuilder indent = new StringBuilder(); + if (plumbing) { + indent.append("H:"); + } else { + for (int i = 0; i < indentCount; ++i) { + indent.append(" "); + } + } + final StringBuilder s = new StringBuilder(); + for (final String optionKey : mAttributes.keySet()) { + s.append(indent); + s.append(optionKey); + s.append(" = "); + if ("date".equals(optionKey) && !plumbing) { + // Date needs a number of milliseconds, but the dictionary contains seconds + s.append(new Date( + 1000 * Long.parseLong(mAttributes.get(optionKey))).toString()); + } else { + s.append(mAttributes.get(optionKey)); + } + s.append("\n"); + } + return s.toString(); + } + } + + /** * Returns new dictionary decoder. * * @param dictFile the dictionary file. diff --git a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java index e2be907ff..f60b3af4f 100644 --- a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java +++ b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java @@ -18,12 +18,11 @@ package com.android.inputmethod.latin.makedict; import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.latin.Constants; +import com.android.inputmethod.latin.makedict.FormatSpec.DictionaryOptions; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.Date; -import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; @@ -280,45 +279,6 @@ public final class FusionDictionary implements Iterable<WordProperty> { } } - /** - * Options global to the dictionary. - */ - public static final class DictionaryOptions { - public final HashMap<String, String> mAttributes; - public DictionaryOptions(final HashMap<String, String> attributes) { - mAttributes = attributes; - } - @Override - public String toString() { // Convenience method - return toString(0, false); - } - public String toString(final int indentCount, final boolean plumbing) { - final StringBuilder indent = new StringBuilder(); - if (plumbing) { - indent.append("H:"); - } else { - for (int i = 0; i < indentCount; ++i) { - indent.append(" "); - } - } - final StringBuilder s = new StringBuilder(); - for (final String optionKey : mAttributes.keySet()) { - s.append(indent); - s.append(optionKey); - s.append(" = "); - if ("date".equals(optionKey) && !plumbing) { - // Date needs a number of milliseconds, but the dictionary contains seconds - s.append(new Date( - 1000 * Long.parseLong(mAttributes.get(optionKey))).toString()); - } else { - s.append(mAttributes.get(optionKey)); - } - s.append("\n"); - } - return s.toString(); - } - } - public final DictionaryOptions mOptions; public final PtNodeArray mRootNodeArray; |