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
24a63b55
Commit
24a63b55
authored
12 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Simplification (A116)
Change-Id: I97cf92a7b0dabc251dd241b24978ea00d1e5f047
parent
f5b55cb7
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/AutoCorrection.java
+2
-1
2 additions, 1 deletion
java/src/com/android/inputmethod/latin/AutoCorrection.java
java/src/com/android/inputmethod/latin/Suggest.java
+6
-8
6 additions, 8 deletions
java/src/com/android/inputmethod/latin/Suggest.java
with
8 additions
and
9 deletions
java/src/com/android/inputmethod/latin/AutoCorrection.java
+
2
−
1
View file @
24a63b55
...
@@ -92,7 +92,8 @@ public class AutoCorrection {
...
@@ -92,7 +92,8 @@ public class AutoCorrection {
public
static
boolean
suggestionExceedsAutoCorrectionThreshold
(
SuggestedWordInfo
suggestion
,
public
static
boolean
suggestionExceedsAutoCorrectionThreshold
(
SuggestedWordInfo
suggestion
,
CharSequence
consideredWord
,
float
autoCorrectionThreshold
)
{
CharSequence
consideredWord
,
float
autoCorrectionThreshold
)
{
if
(
null
!=
suggestion
)
{
if
(
null
!=
suggestion
)
{
//final int autoCorrectionSuggestionScore = sortedScores[0];
// Shortlist a whitelisted word
if
(
suggestion
.
mKind
==
SuggestedWordInfo
.
KIND_WHITELIST
)
return
true
;
final
int
autoCorrectionSuggestionScore
=
suggestion
.
mScore
;
final
int
autoCorrectionSuggestionScore
=
suggestion
.
mScore
;
// TODO: when the normalized score of the first suggestion is nearly equals to
// TODO: when the normalized score of the first suggestion is nearly equals to
// the normalized score of the second suggestion, behave less aggressive.
// the normalized score of the second suggestion, behave less aggressive.
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/Suggest.java
+
6
−
8
View file @
24a63b55
...
@@ -205,6 +205,12 @@ public class Suggest {
...
@@ -205,6 +205,12 @@ public class Suggest {
final
CharSequence
whitelistedWord
=
final
CharSequence
whitelistedWord
=
mWhiteListDictionary
.
getWhitelistedWord
(
consideredWord
);
mWhiteListDictionary
.
getWhitelistedWord
(
consideredWord
);
if
(
whitelistedWord
!=
null
)
{
// MAX_SCORE ensures this will be considered strong enough to be auto-corrected
suggestionsSet
.
add
(
new
SuggestedWordInfo
(
whitelistedWord
,
SuggestedWordInfo
.
MAX_SCORE
,
SuggestedWordInfo
.
KIND_WHITELIST
,
Dictionary
.
TYPE_WHITELIST
));
}
final
boolean
hasAutoCorrection
;
final
boolean
hasAutoCorrection
;
// TODO: using isCorrectionEnabled here is not very good. It's probably useless, because
// TODO: using isCorrectionEnabled here is not very good. It's probably useless, because
...
@@ -222,8 +228,6 @@ public class Suggest {
...
@@ -222,8 +228,6 @@ public class Suggest {
// would always auto-correct to "Will" which is unwanted. Hence, no main dict => no
// would always auto-correct to "Will" which is unwanted. Hence, no main dict => no
// auto-correct.
// auto-correct.
hasAutoCorrection
=
false
;
hasAutoCorrection
=
false
;
}
else
if
(
null
!=
whitelistedWord
)
{
hasAutoCorrection
=
true
;
}
else
if
(
suggestionsSet
.
isEmpty
())
{
}
else
if
(
suggestionsSet
.
isEmpty
())
{
hasAutoCorrection
=
false
;
hasAutoCorrection
=
false
;
}
else
if
(
AutoCorrection
.
suggestionExceedsAutoCorrectionThreshold
(
suggestionsSet
.
first
(),
}
else
if
(
AutoCorrection
.
suggestionExceedsAutoCorrectionThreshold
(
suggestionsSet
.
first
(),
...
@@ -233,12 +237,6 @@ public class Suggest {
...
@@ -233,12 +237,6 @@ public class Suggest {
hasAutoCorrection
=
false
;
hasAutoCorrection
=
false
;
}
}
if
(
whitelistedWord
!=
null
)
{
suggestionsSet
.
add
(
new
SuggestedWordInfo
(
whitelistedWord
,
SuggestedWordInfo
.
MAX_SCORE
,
SuggestedWordInfo
.
KIND_WHITELIST
,
Dictionary
.
TYPE_WHITELIST
));
}
final
ArrayList
<
SuggestedWordInfo
>
suggestionsContainer
=
final
ArrayList
<
SuggestedWordInfo
>
suggestionsContainer
=
new
ArrayList
<
SuggestedWordInfo
>(
suggestionsSet
);
new
ArrayList
<
SuggestedWordInfo
>(
suggestionsSet
);
final
int
suggestionsCount
=
suggestionsContainer
.
size
();
final
int
suggestionsCount
=
suggestionsContainer
.
size
();
...
...
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