Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
f309f228
Commit
f309f228
authored
11 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Don't auto-correct to non-whitelist shortcuts
Bug: 11076722 Change-Id: I0de10ab24d33ec31f45664fe92d80d5a7bec9c20
parent
f3204eeb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/com/android/inputmethod/latin/Suggest.java
+4
-2
4 additions, 2 deletions
java/src/com/android/inputmethod/latin/Suggest.java
native/jni/src/suggest/core/dictionary/shortcut_utils.h
+1
-1
1 addition, 1 deletion
native/jni/src/suggest/core/dictionary/shortcut_utils.h
with
5 additions
and
3 deletions
java/src/com/android/inputmethod/latin/Suggest.java
+
4
−
2
View file @
f309f228
...
...
@@ -286,14 +286,16 @@ public final class Suggest {
// the word *would* have been auto-corrected.
if
(!
isCorrectionEnabled
||
!
allowsToBeAutoCorrected
||
!
wordComposer
.
isComposingWord
()
||
suggestionsSet
.
isEmpty
()
||
wordComposer
.
hasDigits
()
||
wordComposer
.
isMostlyCaps
()
||
wordComposer
.
isResumed
()
||
!
hasMainDictionary
()
)
{
||
wordComposer
.
isMostlyCaps
()
||
wordComposer
.
isResumed
()
||
!
hasMainDictionary
()
||
SuggestedWordInfo
.
KIND_SHORTCUT
==
suggestionsSet
.
first
().
mKind
)
{
// If we don't have a main dictionary, we never want to auto-correct. The reason for
// this is, the user may have a contact whose name happens to match a valid word in
// their language, and it will unexpectedly auto-correct. For example, if the user
// types in English with no dictionary and has a "Will" in their contact list, "will"
// would always auto-correct to "Will" which is unwanted. Hence, no main dict => no
// auto-correct.
// Also, shortcuts should never auto-correct unless they are whitelist entries.
// TODO: we may want to have shortcut-only entries auto-correct in the future.
hasAutoCorrection
=
false
;
}
else
{
hasAutoCorrection
=
AutoCorrectionUtils
.
suggestionExceedsAutoCorrectionThreshold
(
...
...
This diff is collapsed.
Click to expand it.
native/jni/src/suggest/core/dictionary/shortcut_utils.h
+
1
−
1
View file @
f309f228
...
...
@@ -44,7 +44,7 @@ class ShortcutUtils {
shortcutScore
=
finalScore
;
// Protection against int underflow
shortcutScore
=
max
(
S_INT_MIN
+
1
,
shortcutScore
)
-
1
;
kind
=
Dictionary
::
KIND_
CORRECTION
;
kind
=
Dictionary
::
KIND_
SHORTCUT
;
}
outputTypes
[
outputWordIndex
]
=
kind
;
frequencies
[
outputWordIndex
]
=
shortcutScore
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment