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
ca3e7cbd
Commit
ca3e7cbd
authored
13 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Move a computation closer to where it's used.
Change-Id: I5aee4c36ceaacbb1dbfc47c011f1e4aec4b9dca6
parent
eb5ffdac
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
+8
-8
8 additions, 8 deletions
java/src/com/android/inputmethod/latin/Suggest.java
with
8 additions
and
8 deletions
java/src/com/android/inputmethod/latin/Suggest.java
+
8
−
8
View file @
ca3e7cbd
...
@@ -296,14 +296,6 @@ public class Suggest implements Dictionary.WordCallback {
...
@@ -296,14 +296,6 @@ public class Suggest implements Dictionary.WordCallback {
LatinImeLogger
.
onAddSuggestedWord
(
typedWord
,
Suggest
.
DIC_USER_TYPED
,
Dictionary
.
UNIGRAM
);
LatinImeLogger
.
onAddSuggestedWord
(
typedWord
,
Suggest
.
DIC_USER_TYPED
,
Dictionary
.
UNIGRAM
);
mConsideredWord
=
consideredWord
;
mConsideredWord
=
consideredWord
;
// 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
.
allowsToBeAutoCorrected
(
getUnigramDictionaries
(),
consideredWord
,
wordComposer
.
isFirstCharCapitalized
());
if
(
wordComposer
.
size
()
<=
1
&&
(
correctionMode
==
CORRECTION_FULL_BIGRAM
))
{
if
(
wordComposer
.
size
()
<=
1
&&
(
correctionMode
==
CORRECTION_FULL_BIGRAM
))
{
// At first character typed, search only the bigrams
// At first character typed, search only the bigrams
Arrays
.
fill
(
mBigramScores
,
0
);
Arrays
.
fill
(
mBigramScores
,
0
);
...
@@ -398,6 +390,14 @@ public class Suggest implements Dictionary.WordCallback {
...
@@ -398,6 +390,14 @@ public class Suggest implements Dictionary.WordCallback {
suggestionsList
=
SuggestedWords
.
getFromCharSequenceList
(
mSuggestions
);
suggestionsList
=
SuggestedWords
.
getFromCharSequenceList
(
mSuggestions
);
}
}
// 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
.
allowsToBeAutoCorrected
(
getUnigramDictionaries
(),
consideredWord
,
wordComposer
.
isFirstCharCapitalized
());
boolean
autoCorrectionAvailable
=
hasAutoCorrection
;
boolean
autoCorrectionAvailable
=
hasAutoCorrection
;
if
(
correctionMode
==
CORRECTION_FULL
||
correctionMode
==
CORRECTION_FULL_BIGRAM
)
{
if
(
correctionMode
==
CORRECTION_FULL
||
correctionMode
==
CORRECTION_FULL_BIGRAM
)
{
autoCorrectionAvailable
|=
!
allowsToBeAutoCorrected
;
autoCorrectionAvailable
|=
!
allowsToBeAutoCorrected
;
...
...
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