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
a86c0f1e
Commit
a86c0f1e
authored
12 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Stop meaningless bigram computations
Bug: 6313806 Change-Id: Idf765b40812a43de13aa166ed0b44c7b5f7cc218
parent
8dced70b
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
+0
-33
0 additions, 33 deletions
java/src/com/android/inputmethod/latin/Suggest.java
with
0 additions
and
33 deletions
java/src/com/android/inputmethod/latin/Suggest.java
+
0
−
33
View file @
a86c0f1e
...
...
@@ -43,20 +43,6 @@ public class Suggest implements Dictionary.WordCallback {
public
static
final
int
CORRECTION_FULL
=
1
;
public
static
final
int
CORRECTION_FULL_BIGRAM
=
2
;
/**
* Words that appear in both bigram and unigram data gets multiplier ranging from
* BIGRAM_MULTIPLIER_MIN to BIGRAM_MULTIPLIER_MAX depending on the score from
* bigram data.
*/
public
static
final
double
BIGRAM_MULTIPLIER_MIN
=
1.2
;
public
static
final
double
BIGRAM_MULTIPLIER_MAX
=
1.5
;
/**
* Maximum possible bigram frequency. Will depend on how many bits are being used in data
* structure. Maximum bigram frequency will get the BIGRAM_MULTIPLIER_MAX as the multiplier.
*/
public
static
final
int
MAXIMUM_BIGRAM_FREQUENCY
=
127
;
// It seems the following values are only used for logging.
public
static
final
int
DIC_USER_TYPED
=
0
;
public
static
final
int
DIC_MAIN
=
1
;
...
...
@@ -476,25 +462,6 @@ public class Suggest implements Dictionary.WordCallback {
}
}
}
else
{
if
(
dataType
==
Dictionary
.
UNIGRAM
)
{
// Check if the word was already added before (by bigram data)
int
bigramSuggestion
=
searchBigramSuggestion
(
word
,
offset
,
length
);
if
(
bigramSuggestion
>=
0
)
{
dataTypeForLog
=
Dictionary
.
BIGRAM
;
// turn freq from bigram into multiplier specified above
double
multiplier
=
(((
double
)
mBigramSuggestions
.
get
(
bigramSuggestion
).
mScore
)
/
MAXIMUM_BIGRAM_FREQUENCY
)
*
(
BIGRAM_MULTIPLIER_MAX
-
BIGRAM_MULTIPLIER_MIN
)
+
BIGRAM_MULTIPLIER_MIN
;
/* Log.d(TAG,"bigram num: " + bigramSuggestion
+ " wordB: " + mBigramSuggestions.get(bigramSuggestion).toString()
+ " currentScore: " + score + " bigramScore: "
+ mBigramScores[bigramSuggestion]
+ " multiplier: " + multiplier); */
score
=
(
int
)
Math
.
round
((
score
*
multiplier
));
}
}
// Check the last one's score and bail
if
(
suggestions
.
size
()
>=
prefMaxSuggestions
&&
suggestions
.
get
(
prefMaxSuggestions
-
1
).
mScore
>=
score
)
return
true
;
...
...
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