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
8cb63c2f
Commit
8cb63c2f
authored
1 month ago
by
Aleksandras Kostarevas
Browse files
Options
Downloads
Patches
Plain Diff
Add case to lowercase LM words if dict prefers lowercased
parent
e40afbb3
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/org/futo/inputmethod/latin/xlm/LanguageModelFacilitator.kt
+11
-0
11 additions, 0 deletions
...rg/futo/inputmethod/latin/xlm/LanguageModelFacilitator.kt
with
11 additions
and
0 deletions
java/src/org/futo/inputmethod/latin/xlm/LanguageModelFacilitator.kt
+
11
−
0
View file @
8cb63c2f
...
...
@@ -407,6 +407,17 @@ public class LanguageModelFacilitator(
filtered
.
add
(
maxWord
)
}
// In some cases the LM will predict an uppercased word but dictionary predicts lowercased,
// we should prefer the lowercase version to reduce automatically capitalizing which can be
// annoying
val
bothAlgorithmsCameToSameConclusionButLowerCased
=
maxWordDict
?.
mWord
==
maxWord
?.
mWord
?.
lowercase
()
if
(
bothAlgorithmsCameToSameConclusionButLowerCased
&&
maxWord
!=
null
&&
maxWordDict
!=
null
)
{
val
clone
=
maxWordDict
.
scoreAtLeast
(
maxWord
)
autocorrectWord
=
clone
suggestionResults
.
add
(
clone
)
filtered
.
add
(
maxWordDict
)
}
if
(
transformerWeight
<=
0.0f
)
{
if
(
suggestedWordsDictList
.
isNullOrEmpty
())
{
transformerWeight
=
1.0f
...
...
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