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
99d5fda1
Commit
99d5fda1
authored
10 months ago
by
Aleksandras Kostarevas
Browse files
Options
Downloads
Patches
Plain Diff
Fix incorrect LM results with number row
parent
918f0dbd
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
native/jni/org_futo_inputmethod_latin_xlm_LanguageModel.cpp
+16
-6
16 additions, 6 deletions
native/jni/org_futo_inputmethod_latin_xlm_LanguageModel.cpp
with
16 additions
and
6 deletions
native/jni/org_futo_inputmethod_latin_xlm_LanguageModel.cpp
+
16
−
6
View file @
99d5fda1
...
...
@@ -1016,8 +1016,14 @@ namespace latinime {
std
::
vector
<
TokenMix
>
mixes
;
for
(
int
i
=
0
;
i
<
inputSize
;
i
++
)
{
char
wc
=
partialWordString
[
i
];
if
(
!
(
wc
>=
'a'
&&
wc
<=
'z'
)
&&
!
(
wc
>=
'A'
&&
wc
<=
'Z'
))
continue
;
if
(
xCoordinates
[
i
]
==
-
1
||
yCoordinates
[
i
]
==
-
1
)
continue
;
if
(
!
(
wc
>=
'a'
&&
wc
<=
'z'
)
&&
!
(
wc
>=
'A'
&&
wc
<=
'Z'
))
{
//AKLOGI("%d | Char %c skipped due to not within range", i, wc);
continue
;
}
if
(
xCoordinates
[
i
]
==
-
1
||
yCoordinates
[
i
]
==
-
1
)
{
//AKLOGI("%d | Char %c skipped due to -1", i, wc);
continue
;
}
std
::
vector
<
float
>
proportions
=
pInfo
->
decomposeTapPosition
(
xCoordinates
[
i
],
yCoordinates
[
i
]);
for
(
float
&
f
:
proportions
)
{
...
...
@@ -1034,14 +1040,15 @@ namespace latinime {
bool
needs_resorting
=
false
;
int
num_symbols
=
0
;
for
(
int
s
=
0
;
s
<
100
;
s
++
)
{
for
(
int
s
=
0
;
s
<
4
;
s
++
)
{
num_symbols
=
0
;
for
(
int
j
=
0
;
j
<
NUM_TOKEN_MIX
;
j
++
)
{
char
c
=
(
char
)
(
pInfo
->
getKeyCodePoint
(
index_value
[
j
].
second
));
if
(
c
>=
'a'
&&
c
<=
'z'
)
{
}
else
if
(
c
>=
'A'
&&
c
<=
'Z'
)
{
}
else
{
index_value
[
j
].
first
=
-
99999
.0
f
;
}
else
if
(
index_value
[
j
].
first
>
0.0
f
)
{
index_value
[
j
].
first
=
0
.0
f
;
needs_resorting
=
true
;
num_symbols
++
;
}
...
...
@@ -1050,7 +1057,10 @@ namespace latinime {
if
(
!
needs_resorting
)
break
;
sortProbabilityPairVectorDescending
(
index_value
,
NUM_TOKEN_MIX
);
}
if
(
num_symbols
==
NUM_TOKEN_MIX
)
continue
;
// Skip the symbol character
if
(
num_symbols
==
NUM_TOKEN_MIX
)
{
//AKLOGI("%d | Char %c skipped due to num_symbols == NUM_TOKEN_MIX", i, wc);
continue
;
};
// Skip the symbol character
float
total_sum
=
0.0
f
;
for
(
int
j
=
0
;
j
<
NUM_TOKEN_MIX
;
j
++
)
{
...
...
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