diff options
author | 2014-05-30 14:32:57 +0900 | |
---|---|---|
committer | 2014-05-30 18:04:39 +0900 | |
commit | fa0e76dde606c288e4df20b779995cbce3b187fb (patch) | |
tree | 251d2c832080d951a6b66aab6164dd1840e376fe /java/src/com/android/inputmethod/latin/Constants.java | |
parent | 6fe326ae42c084f03557d16cb098bb230494dde4 (diff) | |
download | latinime-fa0e76dde606c288e4df20b779995cbce3b187fb.tar.gz latinime-fa0e76dde606c288e4df20b779995cbce3b187fb.tar.xz latinime-fa0e76dde606c288e4df20b779995cbce3b187fb.zip |
Limit recapitalization for reasonable performance.
At 100k text, it's reasonably fast (less than 1s on latest hardware).
Bug: 12913404
Change-Id: I426b918b2610af24364934a1c37a7314f1142ad0
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Constants.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Constants.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/Constants.java b/java/src/com/android/inputmethod/latin/Constants.java index efc5a618b..05d34767c 100644 --- a/java/src/com/android/inputmethod/latin/Constants.java +++ b/java/src/com/android/inputmethod/latin/Constants.java @@ -158,6 +158,10 @@ public final class Constants { // A hint on how many characters to cache from the TextView. A good value of this is given by // how many characters we need to be able to almost always find the caps mode. public static final int EDITOR_CONTENTS_CACHE_SIZE = 1024; + // How many characters we accept for the recapitalization functionality. This needs to be + // large enough for all reasonable purposes, but avoid purposeful attacks. 100k sounds about + // right for this. + public static final int MAX_CHARACTERS_FOR_RECAPITALIZATION = 1024 * 100; // Must be equal to MAX_WORD_LENGTH in native/jni/src/defines.h public static final int DICTIONARY_MAX_WORD_LENGTH = 48; |