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
70f2762e
Commit
70f2762e
authored
11 years ago
by
Satoshi Kataoka
Browse files
Options
Downloads
Patches
Plain Diff
Make aggressive threshold really aggressive
Bug: 8701480 Change-Id: If8242cfe61f3e56712fd6e25e36858cff7f0d177
parent
3ee39be1
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/res/values/config.xml
+3
-2
3 additions, 2 deletions
java/res/values/config.xml
java/src/com/android/inputmethod/latin/SettingsValues.java
+10
-3
10 additions, 3 deletions
java/src/com/android/inputmethod/latin/SettingsValues.java
with
13 additions
and
5 deletions
java/res/values/config.xml
+
3
−
2
View file @
70f2762e
...
@@ -111,8 +111,9 @@
...
@@ -111,8 +111,9 @@
<!-- Aggressive -->
<!-- Aggressive -->
<item>
0.067
</item>
<item>
0.067
</item>
<!-- Very Aggressive : Suggestion whose normalized score is greater than this value
<!-- Very Aggressive : Suggestion whose normalized score is greater than this value
will be subject to auto-correction. -->
will be subject to auto-correction. "floatNegativeInfinity" is a special marker
<item>
0
</item>
string for Float.NEGATIVE_INFINITY -->
<item>
floatNegativeInfinity
</item>
</string-array>
</string-array>
<!-- Threshold of the normalized score of the best suggestion for the spell checker to declare
<!-- Threshold of the normalized score of the best suggestion for the spell checker to declare
a word to be "recommended" -->
a word to be "recommended" -->
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/SettingsValues.java
+
10
−
3
View file @
70f2762e
...
@@ -34,6 +34,9 @@ import java.util.Arrays;
...
@@ -34,6 +34,9 @@ import java.util.Arrays;
*/
*/
public
final
class
SettingsValues
{
public
final
class
SettingsValues
{
private
static
final
String
TAG
=
SettingsValues
.
class
.
getSimpleName
();
private
static
final
String
TAG
=
SettingsValues
.
class
.
getSimpleName
();
// "floatNegativeInfinity" is a special marker string for Float.NEGATIVE_INFINITE
// currently used for auto-correction
private
static
final
String
FLOAT_NEGATIVE_INFINITY_MARKER_STRING
=
"floatNegativeInfinity"
;
// From resources:
// From resources:
public
final
int
mDelayUpdateOldSuggestions
;
public
final
int
mDelayUpdateOldSuggestions
;
...
@@ -266,8 +269,12 @@ public final class SettingsValues {
...
@@ -266,8 +269,12 @@ public final class SettingsValues {
try
{
try
{
final
int
arrayIndex
=
Integer
.
valueOf
(
currentAutoCorrectionSetting
);
final
int
arrayIndex
=
Integer
.
valueOf
(
currentAutoCorrectionSetting
);
if
(
arrayIndex
>=
0
&&
arrayIndex
<
autoCorrectionThresholdValues
.
length
)
{
if
(
arrayIndex
>=
0
&&
arrayIndex
<
autoCorrectionThresholdValues
.
length
)
{
autoCorrectionThreshold
=
Float
.
parseFloat
(
final
String
val
=
autoCorrectionThresholdValues
[
arrayIndex
];
autoCorrectionThresholdValues
[
arrayIndex
]);
if
(
FLOAT_NEGATIVE_INFINITY_MARKER_STRING
.
equals
(
val
))
{
autoCorrectionThreshold
=
Float
.
NEGATIVE_INFINITY
;
}
else
{
autoCorrectionThreshold
=
Float
.
parseFloat
(
val
);
}
}
}
}
catch
(
NumberFormatException
e
)
{
}
catch
(
NumberFormatException
e
)
{
// Whenever the threshold settings are correct, never come here.
// Whenever the threshold settings are correct, never come here.
...
@@ -275,7 +282,7 @@ public final class SettingsValues {
...
@@ -275,7 +282,7 @@ public final class SettingsValues {
Log
.
w
(
TAG
,
"Cannot load auto correction threshold setting."
Log
.
w
(
TAG
,
"Cannot load auto correction threshold setting."
+
" currentAutoCorrectionSetting: "
+
currentAutoCorrectionSetting
+
" currentAutoCorrectionSetting: "
+
currentAutoCorrectionSetting
+
", autoCorrectionThresholdValues: "
+
", autoCorrectionThresholdValues: "
+
Arrays
.
toString
(
autoCorrectionThresholdValues
));
+
Arrays
.
toString
(
autoCorrectionThresholdValues
)
,
e
);
}
}
return
autoCorrectionThreshold
;
return
autoCorrectionThreshold
;
}
}
...
...
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