aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod/latin/WordComposer.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-01-24 07:34:07 -0800
committerAmith Yamasani <yamasani@google.com>2010-01-24 07:34:07 -0800
commit1c551251106e506c70fad7ba0cb8b1e2a7dff3a9 (patch)
tree880f7e2f8fb3190d82fd4c84cce84548a0ef8277 /src/com/android/inputmethod/latin/WordComposer.java
parent39acd7e80a84100e46386fc6e267c9b4754be764 (diff)
downloadlatinime-1c551251106e506c70fad7ba0cb8b1e2a7dff3a9.tar.gz
latinime-1c551251106e506c70fad7ba0cb8b1e2a7dff3a9.tar.xz
latinime-1c551251106e506c70fad7ba0cb8b1e2a7dff3a9.zip
Auto-added words will only be capitalized if user intended to. #2373284
If a user creates a new word at the beginning of a sentence, then don't add it as a capitalized word in the dictionary.
Diffstat (limited to 'src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r--src/com/android/inputmethod/latin/WordComposer.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/inputmethod/latin/WordComposer.java b/src/com/android/inputmethod/latin/WordComposer.java
index 50725d481..e97cb24ba 100644
--- a/src/com/android/inputmethod/latin/WordComposer.java
+++ b/src/com/android/inputmethod/latin/WordComposer.java
@@ -36,6 +36,8 @@ public class WordComposer {
private StringBuilder mTypedWord;
private int mCapsCount;
+
+ private boolean mAutoCapitalized;
/**
* Whether the user chose to capitalize the word.
@@ -152,4 +154,21 @@ public class WordComposer {
public boolean isMostlyCaps() {
return mCapsCount > 1;
}
+
+ /**
+ * Saves the reason why the word is capitalized - whether it was automatic or
+ * due to the user hitting shift in the middle of a sentence.
+ * @param auto whether it was an automatic capitalization due to start of sentence
+ */
+ public void setAutoCapitalized(boolean auto) {
+ mAutoCapitalized = auto;
+ }
+
+ /**
+ * Returns whether the word was automatically capitalized.
+ * @return whether the word was automatically capitalized
+ */
+ public boolean isAutoCapitalized() {
+ return mAutoCapitalized;
+ }
}