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
200ece79
Commit
200ece79
authored
14 years ago
by
Ken Wakasa
Browse files
Options
Downloads
Patches
Plain Diff
Capitalization for "Quick Fixes" words doesn't work
bug: 3151706 Change-Id: I7770a1d26edb1ea72ee93396181953a724dcc4bf
parent
b325e811
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
+19
-3
19 additions, 3 deletions
java/src/com/android/inputmethod/latin/Suggest.java
with
19 additions
and
3 deletions
java/src/com/android/inputmethod/latin/Suggest.java
+
19
−
3
View file @
200ece79
...
@@ -337,8 +337,25 @@ public class Suggest implements Dictionary.WordCallback {
...
@@ -337,8 +337,25 @@ public class Suggest implements Dictionary.WordCallback {
String
suggestedWord
=
mSuggestions
.
get
(
i
).
toString
().
toLowerCase
();
String
suggestedWord
=
mSuggestions
.
get
(
i
).
toString
().
toLowerCase
();
CharSequence
autoText
=
CharSequence
autoText
=
AutoText
.
get
(
suggestedWord
,
0
,
suggestedWord
.
length
(),
view
);
AutoText
.
get
(
suggestedWord
,
0
,
suggestedWord
.
length
(),
view
);
// Is there an AutoText correction?
// Is there an AutoText
(also known as Quick Fixes)
correction?
boolean
canAdd
=
autoText
!=
null
;
boolean
canAdd
=
autoText
!=
null
;
// Capitalize as needed
final
int
autoTextLength
=
autoText
!=
null
?
autoText
.
length
()
:
0
;
if
(
autoTextLength
>
0
&&
(
mIsAllUpperCase
||
mIsFirstCharCapitalized
))
{
int
poolSize
=
mStringPool
.
size
();
StringBuilder
sb
=
poolSize
>
0
?
(
StringBuilder
)
mStringPool
.
remove
(
poolSize
-
1
)
:
new
StringBuilder
(
getApproxMaxWordLength
());
sb
.
setLength
(
0
);
if
(
mIsAllUpperCase
)
{
sb
.
append
(
autoText
.
toString
().
toUpperCase
());
}
else
if
(
mIsFirstCharCapitalized
)
{
sb
.
append
(
Character
.
toUpperCase
(
autoText
.
charAt
(
0
)));
if
(
autoTextLength
>
1
)
{
sb
.
append
(
autoText
.
subSequence
(
1
,
autoTextLength
));
}
}
autoText
=
sb
.
toString
();
}
// Is that correction already the current prediction (or original word)?
// Is that correction already the current prediction (or original word)?
canAdd
&=
!
TextUtils
.
equals
(
autoText
,
mSuggestions
.
get
(
i
));
canAdd
&=
!
TextUtils
.
equals
(
autoText
,
mSuggestions
.
get
(
i
));
// Is that correction already the next predicted word?
// Is that correction already the next predicted word?
...
@@ -461,8 +478,7 @@ public class Suggest implements Dictionary.WordCallback {
...
@@ -461,8 +478,7 @@ public class Suggest implements Dictionary.WordCallback {
return
true
;
return
true
;
}
}
System
.
arraycopy
(
priorities
,
pos
,
priorities
,
pos
+
1
,
System
.
arraycopy
(
priorities
,
pos
,
priorities
,
pos
+
1
,
prefMaxSuggestions
-
pos
-
1
);
prefMaxSuggestions
-
pos
-
1
);
priorities
[
pos
]
=
freq
;
priorities
[
pos
]
=
freq
;
int
poolSize
=
mStringPool
.
size
();
int
poolSize
=
mStringPool
.
size
();
StringBuilder
sb
=
poolSize
>
0
?
(
StringBuilder
)
mStringPool
.
remove
(
poolSize
-
1
)
StringBuilder
sb
=
poolSize
>
0
?
(
StringBuilder
)
mStringPool
.
remove
(
poolSize
-
1
)
...
...
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