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
6f233f7b
Commit
6f233f7b
authored
12 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Remove useless member variables (A93)
Change-Id: Iff0a0e8835f4d630b51a15c0d91881437094e785
parent
2ae75ed5
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/BinaryDictionary.java
+13
-14
13 additions, 14 deletions
java/src/com/android/inputmethod/latin/BinaryDictionary.java
with
13 additions
and
14 deletions
java/src/com/android/inputmethod/latin/BinaryDictionary.java
+
13
−
14
View file @
6f233f7b
...
@@ -46,16 +46,15 @@ public class BinaryDictionary extends Dictionary {
...
@@ -46,16 +46,15 @@ public class BinaryDictionary extends Dictionary {
private
static
final
String
TAG
=
"BinaryDictionary"
;
private
static
final
String
TAG
=
"BinaryDictionary"
;
private
static
final
int
MAX_BIGRAMS
=
60
;
private
static
final
int
MAX_BIGRAMS
=
60
;
private
static
final
int
MAX_RESULTS
=
MAX_BIGRAMS
>
MAX_WORDS
?
MAX_BIGRAMS
:
MAX_WORDS
;
private
static
final
int
TYPED_LETTER_MULTIPLIER
=
2
;
private
static
final
int
TYPED_LETTER_MULTIPLIER
=
2
;
private
long
mNativeDict
;
private
long
mNativeDict
;
private
final
int
[]
mInputCodes
=
new
int
[
MAX_WORD_LENGTH
];
private
final
int
[]
mInputCodes
=
new
int
[
MAX_WORD_LENGTH
];
private
final
char
[]
mOutputChars
=
new
char
[
MAX_WORD_LENGTH
*
MAX_WORDS
];
private
final
char
[]
mOutputChars
=
new
char
[
MAX_WORD_LENGTH
*
MAX_RESULTS
];
private
final
char
[]
mOutputChars_bigrams
=
new
char
[
MAX_WORD_LENGTH
*
MAX_BIGRAMS
];
private
final
int
[]
mSpaceIndices
=
new
int
[
MAX_SPACES
];
private
final
int
[]
mSpaceIndices
=
new
int
[
MAX_SPACES
];
private
final
int
[]
mScores
=
new
int
[
MAX_WORDS
];
private
final
int
[]
mOutputScores
=
new
int
[
MAX_RESULTS
];
private
final
int
[]
mBigramScores
=
new
int
[
MAX_BIGRAMS
];
private
final
boolean
mUseFullEditDistance
;
private
final
boolean
mUseFullEditDistance
;
...
@@ -121,8 +120,8 @@ public class BinaryDictionary extends Dictionary {
...
@@ -121,8 +120,8 @@ public class BinaryDictionary extends Dictionary {
if
(!
isValidDictionary
())
return
null
;
if
(!
isValidDictionary
())
return
null
;
int
[]
codePoints
=
StringUtils
.
toCodePointArray
(
previousWord
.
toString
());
int
[]
codePoints
=
StringUtils
.
toCodePointArray
(
previousWord
.
toString
());
Arrays
.
fill
(
mOutputChars
_bigrams
,
(
char
)
0
);
Arrays
.
fill
(
mOutputChars
,
(
char
)
0
);
Arrays
.
fill
(
m
Bigram
Scores
,
0
);
Arrays
.
fill
(
m
Output
Scores
,
0
);
int
codesSize
=
codes
.
size
();
int
codesSize
=
codes
.
size
();
Arrays
.
fill
(
mInputCodes
,
-
1
);
Arrays
.
fill
(
mInputCodes
,
-
1
);
...
@@ -131,23 +130,23 @@ public class BinaryDictionary extends Dictionary {
...
@@ -131,23 +130,23 @@ public class BinaryDictionary extends Dictionary {
}
}
int
count
=
getBigramsNative
(
mNativeDict
,
codePoints
,
codePoints
.
length
,
mInputCodes
,
int
count
=
getBigramsNative
(
mNativeDict
,
codePoints
,
codePoints
.
length
,
mInputCodes
,
codesSize
,
mOutputChars
_bigrams
,
mBigram
Scores
,
MAX_WORD_LENGTH
,
MAX_BIGRAMS
);
codesSize
,
mOutputChars
,
mOutput
Scores
,
MAX_WORD_LENGTH
,
MAX_BIGRAMS
);
if
(
count
>
MAX_BIGRAMS
)
{
if
(
count
>
MAX_BIGRAMS
)
{
count
=
MAX_BIGRAMS
;
count
=
MAX_BIGRAMS
;
}
}
final
ArrayList
<
SuggestedWordInfo
>
suggestions
=
new
ArrayList
<
SuggestedWordInfo
>();
final
ArrayList
<
SuggestedWordInfo
>
suggestions
=
new
ArrayList
<
SuggestedWordInfo
>();
for
(
int
j
=
0
;
j
<
count
;
++
j
)
{
for
(
int
j
=
0
;
j
<
count
;
++
j
)
{
if
(
codesSize
>
0
&&
m
Bigram
Scores
[
j
]
<
1
)
break
;
if
(
codesSize
>
0
&&
m
Output
Scores
[
j
]
<
1
)
break
;
final
int
start
=
j
*
MAX_WORD_LENGTH
;
final
int
start
=
j
*
MAX_WORD_LENGTH
;
int
len
=
0
;
int
len
=
0
;
while
(
len
<
MAX_WORD_LENGTH
&&
mOutputChars
_bigrams
[
start
+
len
]
!=
0
)
{
while
(
len
<
MAX_WORD_LENGTH
&&
mOutputChars
[
start
+
len
]
!=
0
)
{
++
len
;
++
len
;
}
}
if
(
len
>
0
)
{
if
(
len
>
0
)
{
suggestions
.
add
(
new
SuggestedWordInfo
(
suggestions
.
add
(
new
SuggestedWordInfo
(
new
String
(
mOutputChars
_bigrams
,
start
,
len
),
new
String
(
mOutputChars
,
start
,
len
),
m
Bigram
Scores
[
j
],
SuggestedWordInfo
.
KIND_CORRECTION
,
mDictType
));
m
Output
Scores
[
j
],
SuggestedWordInfo
.
KIND_CORRECTION
,
mDictType
));
}
}
}
}
return
suggestions
;
return
suggestions
;
...
@@ -160,11 +159,11 @@ public class BinaryDictionary extends Dictionary {
...
@@ -160,11 +159,11 @@ public class BinaryDictionary extends Dictionary {
if
(!
isValidDictionary
())
return
null
;
if
(!
isValidDictionary
())
return
null
;
final
int
count
=
getSuggestions
(
codes
,
prevWordForBigrams
,
proximityInfo
,
mOutputChars
,
final
int
count
=
getSuggestions
(
codes
,
prevWordForBigrams
,
proximityInfo
,
mOutputChars
,
mScores
,
mSpaceIndices
);
m
Output
Scores
,
mSpaceIndices
);
final
ArrayList
<
SuggestedWordInfo
>
suggestions
=
new
ArrayList
<
SuggestedWordInfo
>();
final
ArrayList
<
SuggestedWordInfo
>
suggestions
=
new
ArrayList
<
SuggestedWordInfo
>();
for
(
int
j
=
0
;
j
<
count
;
++
j
)
{
for
(
int
j
=
0
;
j
<
count
;
++
j
)
{
if
(
mScores
[
j
]
<
1
)
break
;
if
(
m
Output
Scores
[
j
]
<
1
)
break
;
final
int
start
=
j
*
MAX_WORD_LENGTH
;
final
int
start
=
j
*
MAX_WORD_LENGTH
;
int
len
=
0
;
int
len
=
0
;
while
(
len
<
MAX_WORD_LENGTH
&&
mOutputChars
[
start
+
len
]
!=
0
)
{
while
(
len
<
MAX_WORD_LENGTH
&&
mOutputChars
[
start
+
len
]
!=
0
)
{
...
@@ -174,7 +173,7 @@ public class BinaryDictionary extends Dictionary {
...
@@ -174,7 +173,7 @@ public class BinaryDictionary extends Dictionary {
// TODO: actually get the kind from native code
// TODO: actually get the kind from native code
suggestions
.
add
(
new
SuggestedWordInfo
(
suggestions
.
add
(
new
SuggestedWordInfo
(
new
String
(
mOutputChars
,
start
,
len
),
new
String
(
mOutputChars
,
start
,
len
),
mScores
[
j
],
SuggestedWordInfo
.
KIND_CORRECTION
,
mDictType
));
m
Output
Scores
[
j
],
SuggestedWordInfo
.
KIND_CORRECTION
,
mDictType
));
}
}
}
}
return
suggestions
;
return
suggestions
;
...
...
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