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
8b166465
Commit
8b166465
authored
12 years ago
by
Jean Chalard
Committed by
Android (Google) Code Review
12 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Inline a method to avoid confusion (A97)"
parents
fd9b4851
e77f2996
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/BinaryDictionary.java
+18
-25
18 additions, 25 deletions
java/src/com/android/inputmethod/latin/BinaryDictionary.java
with
18 additions
and
25 deletions
java/src/com/android/inputmethod/latin/BinaryDictionary.java
+
18
−
25
View file @
8b166465
...
...
@@ -157,7 +157,24 @@ public class BinaryDictionary extends Dictionary {
// proximityInfo and/or prevWordForBigrams may not be null.
private
ArrayList
<
SuggestedWordInfo
>
getWordsInternal
(
final
WordComposer
codes
,
final
int
[]
prevWord
,
final
ProximityInfo
proximityInfo
)
{
final
int
count
=
getWordsInternalInternal
(
codes
,
prevWord
,
proximityInfo
);
final
InputPointers
ips
=
codes
.
getInputPointers
();
final
boolean
isGesture
=
codes
.
isBatchMode
();
final
int
codesSize
;
if
(
isGesture
)
{
codesSize
=
ips
.
getPointerSize
();
}
else
{
codesSize
=
codes
.
size
();
// Won't deal with really long words.
if
(
codesSize
>
MAX_WORD_LENGTH
-
1
)
return
null
;
for
(
int
i
=
0
;
i
<
codesSize
;
i
++)
{
mInputCodes
[
i
]
=
codes
.
getCodeAt
(
i
);
}
}
final
int
count
=
getSuggestionsNative
(
mNativeDict
,
proximityInfo
.
getNativeProximityInfo
(),
ips
.
getXCoordinates
(),
ips
.
getYCoordinates
(),
ips
.
getTimes
(),
ips
.
getPointerIds
(),
mInputCodes
,
codesSize
,
0
/* unused */
,
isGesture
,
prevWord
,
mUseFullEditDistance
,
mOutputChars
,
mOutputScores
,
mSpaceIndices
);
final
ArrayList
<
SuggestedWordInfo
>
suggestions
=
new
ArrayList
<
SuggestedWordInfo
>();
for
(
int
j
=
0
;
j
<
count
;
++
j
)
{
...
...
@@ -181,30 +198,6 @@ public class BinaryDictionary extends Dictionary {
return
mNativeDict
!=
0
;
}
// proximityInfo may not be null.
// TODO: remove this method by inlining it into getWordsInternal
private
int
getWordsInternalInternal
(
final
WordComposer
codes
,
final
int
[]
prevWord
,
final
ProximityInfo
proximityInfo
)
{
final
InputPointers
ips
=
codes
.
getInputPointers
();
final
boolean
isGesture
=
codes
.
isBatchMode
();
final
int
codesSize
;
if
(
isGesture
)
{
codesSize
=
ips
.
getPointerSize
();
}
else
{
codesSize
=
codes
.
size
();
// Won't deal with really long words.
if
(
codesSize
>
MAX_WORD_LENGTH
-
1
)
return
-
1
;
for
(
int
i
=
0
;
i
<
codesSize
;
i
++)
{
mInputCodes
[
i
]
=
codes
.
getCodeAt
(
i
);
}
}
return
getSuggestionsNative
(
mNativeDict
,
proximityInfo
.
getNativeProximityInfo
(),
ips
.
getXCoordinates
(),
ips
.
getYCoordinates
(),
ips
.
getTimes
(),
ips
.
getPointerIds
(),
mInputCodes
,
codesSize
,
0
/* unused */
,
isGesture
,
prevWord
,
mUseFullEditDistance
,
mOutputChars
,
mOutputScores
,
mSpaceIndices
);
}
public
static
float
calcNormalizedScore
(
String
before
,
String
after
,
int
score
)
{
return
calcNormalizedScoreNative
(
before
.
toCharArray
(),
before
.
length
(),
after
.
toCharArray
(),
after
.
length
(),
score
);
...
...
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