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
47d2ef69
Commit
47d2ef69
authored
13 years ago
by
satok
Committed by
Android (Google) Code Review
13 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Change the formula of the missing character."
parents
09df2a5b
dc5301e5
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
native/src/defines.h
+2
-1
2 additions, 1 deletion
native/src/defines.h
native/src/unigram_dictionary.cpp
+6
-3
6 additions, 3 deletions
native/src/unigram_dictionary.cpp
with
8 additions
and
4 deletions
native/src/defines.h
+
2
−
1
View file @
47d2ef69
...
...
@@ -138,7 +138,8 @@ static void prof_out(void) {
#define SUGGEST_WORDS_WITH_SPACE_PROXIMITY true
// The following "rate"s are used as a multiplier before dividing by 100, so they are in percent.
#define WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE 70
#define WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE 90
#define WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X 12
#define WORDS_WITH_MISSING_SPACE_CHARACTER_DEMOTION_RATE 80
#define WORDS_WITH_EXCESSIVE_CHARACTER_DEMOTION_RATE 75
#define WORDS_WITH_EXCESSIVE_CHARACTER_OUT_OF_PROXIMITY_DEMOTION_RATE 75
...
...
This diff is collapsed.
Click to expand it.
native/src/unigram_dictionary.cpp
+
6
−
3
View file @
47d2ef69
...
...
@@ -518,9 +518,12 @@ inline int UnigramDictionary::calculateFinalFreq(const int inputIndex, const int
// TODO: Demote by edit distance
int
finalFreq
=
freq
*
matchWeight
;
if
(
skipPos
>=
0
)
{
if
(
mInputLength
>=
3
)
{
multiplyRate
(
WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE
*
(
mInputLength
-
2
)
/
(
mInputLength
-
1
),
&
finalFreq
);
if
(
mInputLength
>=
2
)
{
const
int
demotionRate
=
WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE
*
(
10
*
mInputLength
-
WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X
)
/
(
10
*
mInputLength
-
WORDS_WITH_MISSING_CHARACTER_DEMOTION_START_POS_10X
+
10
);
multiplyRate
(
demotionRate
,
&
finalFreq
);
}
else
{
finalFreq
=
0
;
}
...
...
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