diff options
author | 2011-09-09 20:54:43 +0900 | |
---|---|---|
committer | 2011-09-12 12:25:25 +0900 | |
commit | f5ef30dfc6f4e436d35c38b6f7e32fbd24d54aab (patch) | |
tree | e6dd83f6fb5c00b86f11c5048fc2965558a6aef4 /java/src/com/android/inputmethod/latin/Utils.java | |
parent | 53bbf4da5a7dee1e2fd84770dc79c80ec4a5caed (diff) | |
download | latinime-f5ef30dfc6f4e436d35c38b6f7e32fbd24d54aab.tar.gz latinime-f5ef30dfc6f4e436d35c38b6f7e32fbd24d54aab.tar.xz latinime-f5ef30dfc6f4e436d35c38b6f7e32fbd24d54aab.zip |
Have the spell checker honor case
Bug: 5281103
Change-Id: I415c84dbb55f1eeb5deb9f248b4056881982ee13
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Utils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Utils.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java index 6263ebefa..c35273edd 100644 --- a/java/src/com/android/inputmethod/latin/Utils.java +++ b/java/src/com/android/inputmethod/latin/Utils.java @@ -757,10 +757,19 @@ public class Utils { return toTitleCase(locale.getLanguage(), locale); } - private static String toTitleCase(String s, Locale locale) { + public static String toTitleCase(String s, Locale locale) { if (s.length() <= 1) { + // TODO: is this really correct? Shouldn't this be s.toUpperCase()? return s; } + // TODO: fix the bugs below + // - This does not work for Greek, because it returns upper case instead of title case. + // - It does not work for Serbian, because it fails to account for the "lj" character, + // which should be "Lj" in title case and "LJ" in upper case. + // - It does not work for Dutch, because it fails to account for the "ij" digraph, which + // are two different characters but both should be capitalized as "IJ" as if they were + // a single letter. + // - It also does not work with unicode surrogate code points. return s.toUpperCase(locale).charAt(0) + s.substring(1); } } |