diff options
author | 2013-04-16 03:25:25 -0700 | |
---|---|---|
committer | 2013-04-16 03:25:25 -0700 | |
commit | a694c9ba08895dbfadd703acb731a383edad8c9f (patch) | |
tree | 027ea97e01deca7db3b804506c49726e89b9f9a9 /java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java | |
parent | 7abeccfa2753806086c083b3ba7b5b96c40b387a (diff) | |
parent | ff766f8c4b92962440d5a11a914971bbf57d46c2 (diff) | |
download | latinime-a694c9ba08895dbfadd703acb731a383edad8c9f.tar.gz latinime-a694c9ba08895dbfadd703acb731a383edad8c9f.tar.xz latinime-a694c9ba08895dbfadd703acb731a383edad8c9f.zip |
am ff766f8c: Merge "Don\'t insert automatic spaces when text looks like a URL"
* commit 'ff766f8c4b92962440d5a11a914971bbf57d46c2':
Don't insert automatic spaces when text looks like a URL
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java index 96b2c818d..da8657201 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java @@ -189,10 +189,12 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session { int letterCount = 0; for (int i = 0; i < length; i = text.offsetByCodePoints(i, 1)) { final int codePoint = text.codePointAt(i); - // Any word containing a '@' is probably an e-mail address - // Any word containing a '/' is probably either an ad-hoc combination of two + // Any word containing a COMMERCIAL_AT is probably an e-mail address + // Any word containing a SLASH is probably either an ad-hoc combination of two // words or a URI - in either case we don't want to spell check that - if ('@' == codePoint || '/' == codePoint) return true; + if (Constants.CODE_COMMERCIAL_AT == codePoint || Constants.CODE_SLASH == codePoint) { + return true; + } if (isLetterCheckableByLanguage(codePoint, script)) ++letterCount; } // Guestimate heuristic: perform spell checking if at least 3/4 of the characters |