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
040aa28e
Commit
040aa28e
authored
12 years ago
by
Tadashi G. Takaoka
Committed by
Android (Google) Code Review
12 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Get rid of redundant CharSequence member from SuggestedWordInfo"
parents
30a324a5
f3897fb5
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/SuggestedWords.java
+8
-10
8 additions, 10 deletions
java/src/com/android/inputmethod/latin/SuggestedWords.java
with
8 additions
and
10 deletions
java/src/com/android/inputmethod/latin/SuggestedWords.java
+
8
−
10
View file @
040aa28e
...
...
@@ -55,7 +55,7 @@ public class SuggestedWords {
return
mSuggestedWordInfoList
.
size
();
}
public
CharSequence
getWord
(
int
pos
)
{
public
String
getWord
(
int
pos
)
{
return
mSuggestedWordInfoList
.
get
(
pos
).
mWord
;
}
...
...
@@ -125,8 +125,7 @@ public class SuggestedWords {
public
static
final
int
KIND_HARDCODED
=
5
;
// Hardcoded suggestion, e.g. punctuation
public
static
final
int
KIND_APP_DEFINED
=
6
;
// Suggested by the application
public
static
final
int
KIND_SHORTCUT
=
7
;
// A shortcut
private
final
String
mWordStr
;
public
final
CharSequence
mWord
;
public
final
String
mWord
;
public
final
int
mScore
;
public
final
int
mKind
;
// one of the KIND_* constants above
public
final
int
mCodePointCount
;
...
...
@@ -135,12 +134,11 @@ public class SuggestedWords {
public
SuggestedWordInfo
(
final
CharSequence
word
,
final
int
score
,
final
int
kind
,
final
String
sourceDict
)
{
mWordStr
=
word
.
toString
();
mWord
=
word
;
mWord
=
word
.
toString
();
mScore
=
score
;
mKind
=
kind
;
mSourceDict
=
sourceDict
;
mCodePointCount
=
StringUtils
.
codePointCount
(
mWord
Str
);
mCodePointCount
=
StringUtils
.
codePointCount
(
mWord
);
}
...
...
@@ -158,15 +156,15 @@ public class SuggestedWords {
}
public
int
codePointAt
(
int
i
)
{
return
mWord
Str
.
codePointAt
(
i
);
return
mWord
.
codePointAt
(
i
);
}
@Override
public
String
toString
()
{
if
(
TextUtils
.
isEmpty
(
mDebugString
))
{
return
mWord
Str
;
return
mWord
;
}
else
{
return
mWord
Str
+
" ("
+
mDebugString
.
toString
()
+
")"
;
return
mWord
+
" ("
+
mDebugString
.
toString
()
+
")"
;
}
}
...
...
@@ -180,7 +178,7 @@ public class SuggestedWords {
final
SuggestedWordInfo
cur
=
candidates
.
get
(
i
);
for
(
int
j
=
0
;
j
<
i
;
++
j
)
{
final
SuggestedWordInfo
previous
=
candidates
.
get
(
j
);
if
(
TextUtils
.
equals
(
cur
.
mWord
,
previous
.
mWord
))
{
if
(
cur
.
mWord
.
equals
(
previous
.
mWord
))
{
candidates
.
remove
(
cur
.
mScore
<
previous
.
mScore
?
i
:
j
);
--
i
;
break
;
...
...
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