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
8c06a468
Commit
8c06a468
authored
12 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Stop auto-correcting non-whitelisted one-char strings
Bug: 7134017 Change-Id: I75cf474dedafda3e1683dd8f7740c13aafdcf5ab
parent
29352761
No related branches found
No related tags found
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
+3
-3
3 additions, 3 deletions
java/src/com/android/inputmethod/latin/AutoCorrection.java
java/src/com/android/inputmethod/latin/Suggest.java
+4
-2
4 additions, 2 deletions
java/src/com/android/inputmethod/latin/Suggest.java
with
7 additions
and
5 deletions
java/src/com/android/inputmethod/latin/AutoCorrection.java
+
3
−
3
View file @
8c06a468
...
@@ -73,11 +73,11 @@ public class AutoCorrection {
...
@@ -73,11 +73,11 @@ public class AutoCorrection {
return
maxFreq
;
return
maxFreq
;
}
}
// Returns true if this is
n't
in any dictionar
y
.
// Returns true if this is in any
of the
dictionar
ies
.
public
static
boolean
is
NotAWord
(
public
static
boolean
is
InTheDictionary
(
final
ConcurrentHashMap
<
String
,
Dictionary
>
dictionaries
,
final
ConcurrentHashMap
<
String
,
Dictionary
>
dictionaries
,
final
CharSequence
word
,
final
boolean
ignoreCase
)
{
final
CharSequence
word
,
final
boolean
ignoreCase
)
{
return
!
isValidWord
(
dictionaries
,
word
,
ignoreCase
);
return
isValidWord
(
dictionaries
,
word
,
ignoreCase
);
}
}
public
static
boolean
suggestionExceedsAutoCorrectionThreshold
(
SuggestedWordInfo
suggestion
,
public
static
boolean
suggestionExceedsAutoCorrectionThreshold
(
SuggestedWordInfo
suggestion
,
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/Suggest.java
+
4
−
2
View file @
8c06a468
...
@@ -214,10 +214,12 @@ public class Suggest {
...
@@ -214,10 +214,12 @@ public class Suggest {
whitelistedWord
=
suggestionsSet
.
first
().
mWord
;
whitelistedWord
=
suggestionsSet
.
first
().
mWord
;
}
}
// The word can be auto-corrected if it has a whitelist entry that is not itself,
// or if it's a 2+ characters non-word (i.e. it's not in the dictionary).
final
boolean
allowsToBeAutoCorrected
=
(
null
!=
whitelistedWord
final
boolean
allowsToBeAutoCorrected
=
(
null
!=
whitelistedWord
&&
!
whitelistedWord
.
equals
(
consideredWord
))
&&
!
whitelistedWord
.
equals
(
consideredWord
))
||
AutoCorrection
.
isNotAWord
(
mDictionaries
,
consideredWord
,
||
(
consideredWord
.
length
()
>
1
&&
!
AutoCorrection
.
isInTheDictionary
(
mDictionaries
,
wordComposer
.
isFirstCharCapitalized
());
consideredWord
,
wordComposer
.
isFirstCharCapitalized
())
)
;
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
...
...
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