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
53196d9e
Commit
53196d9e
authored
3 months ago
by
Aleksandras Kostarevas
Browse files
Options
Downloads
Patches
Plain Diff
Disable autocorrect on words starting with a digit
parent
f9507b00
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/src/org/futo/inputmethod/latin/Suggest.java
+3
-1
3 additions, 1 deletion
java/src/org/futo/inputmethod/latin/Suggest.java
java/src/org/futo/inputmethod/latin/WordComposer.java
+7
-0
7 additions, 0 deletions
java/src/org/futo/inputmethod/latin/WordComposer.java
with
10 additions
and
1 deletion
java/src/org/futo/inputmethod/latin/Suggest.java
+
3
−
1
View file @
53196d9e
...
...
@@ -221,7 +221,9 @@ public final class Suggest {
// being active or not
||
wordComposer
.
isEntirelyDigits
()
// If it's an ordinal (1st, 2nd, 3rd), do not autocorrect
||
wordComposer
.
isOrdinal
(
locale
)
//|| wordComposer.isOrdinal(locale)
// If it starts with a digit, do not autocorrect
||
wordComposer
.
startsWithDigit
()
// If the word is mostly caps, we never auto-correct because this is almost
// certainly intentional (and careful input)
||
wordComposer
.
isMostlyCaps
()
...
...
This diff is collapsed.
Click to expand it.
java/src/org/futo/inputmethod/latin/WordComposer.java
+
7
−
0
View file @
53196d9e
...
...
@@ -372,6 +372,13 @@ public final class WordComposer {
return
word
.
matches
(
"^(\\d+)(st|nd|rd|th)$"
);
}
public
boolean
startsWithDigit
()
{
final
String
word
=
getTypedWord
();
if
(
word
.
isEmpty
())
return
false
;
return
Character
.
isDigit
(
word
.
charAt
(
0
));
}
/**
* Saves the caps mode at the start of composing.
*
...
...
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