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
2631e3b1
Commit
2631e3b1
authored
12 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Small refactoring (A39)
Change-Id: I3c45b5a6571f986acc7adb3a8fe17b210303f7ea
parent
79f53178
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/Suggest.java
+14
-14
14 additions, 14 deletions
java/src/com/android/inputmethod/latin/Suggest.java
with
14 additions
and
14 deletions
java/src/com/android/inputmethod/latin/Suggest.java
+
14
−
14
View file @
2631e3b1
...
@@ -217,6 +217,20 @@ public class Suggest {
...
@@ -217,6 +217,20 @@ public class Suggest {
}
}
}
}
// TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid"
// but still autocorrected from - in the case the whitelist only capitalizes the word.
// The whitelist should be case-insensitive, so it's not possible to be consistent with
// a boolean flag. Right now this is handled with a slight hack in
// WhitelistDictionary#shouldForciblyAutoCorrectFrom.
final
boolean
allowsToBeAutoCorrected
=
AutoCorrection
.
isWhitelistedOrNotAWord
(
mDictionaries
,
consideredWord
,
wordComposer
.
isFirstCharCapitalized
())
// 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.
&&
hasMainDictionary
();
final
CharSequence
whitelistedWord
=
final
CharSequence
whitelistedWord
=
mWhiteListDictionary
.
getWhitelistedWord
(
consideredWord
);
mWhiteListDictionary
.
getWhitelistedWord
(
consideredWord
);
...
@@ -276,20 +290,6 @@ public class Suggest {
...
@@ -276,20 +290,6 @@ public class Suggest {
suggestionsList
=
suggestionsContainer
;
suggestionsList
=
suggestionsContainer
;
}
}
// TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid"
// but still autocorrected from - in the case the whitelist only capitalizes the word.
// The whitelist should be case-insensitive, so it's not possible to be consistent with
// a boolean flag. Right now this is handled with a slight hack in
// WhitelistDictionary#shouldForciblyAutoCorrectFrom.
final
boolean
allowsToBeAutoCorrected
=
AutoCorrection
.
isWhitelistedOrNotAWord
(
mDictionaries
,
consideredWord
,
wordComposer
.
isFirstCharCapitalized
())
// 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.
&&
hasMainDictionary
();
return
new
SuggestedWords
(
suggestionsList
,
return
new
SuggestedWords
(
suggestionsList
,
// TODO: this first argument is lying. If this is a whitelisted word which is an
// TODO: this first argument is lying. If this is a whitelisted word which is an
// actual word, it says typedWordValid = false, which looks wrong. We should either
// actual word, it says typedWordValid = false, which looks wrong. We should either
...
...
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