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
354a59df
Commit
354a59df
authored
10 years ago
by
Keisuke Kuroyanagi
Browse files
Options
Downloads
Patches
Plain Diff
Debug log when failed to add/remove n-gram entry.
Change-Id: Ibf0a4e01e1abc81b09aec104ba39d2ec18f4db8b
parent
43ea8f6e
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/ExpandableBinaryDictionary.java
+12
-5
12 additions, 5 deletions
...android/inputmethod/latin/ExpandableBinaryDictionary.java
with
12 additions
and
5 deletions
java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
+
12
−
5
View file @
354a59df
...
...
@@ -49,6 +49,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
* queries in native code. This binary dictionary is written to internal storage.
*/
abstract
public
class
ExpandableBinaryDictionary
extends
Dictionary
{
private
static
final
boolean
DEBUG
=
false
;
/** Used for Log actions from this class */
private
static
final
String
TAG
=
ExpandableBinaryDictionary
.
class
.
getSimpleName
();
...
...
@@ -325,16 +326,17 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
protected
void
addNgramEntryLocked
(
final
PrevWordsInfo
prevWordsInfo
,
final
String
word
,
final
int
frequency
,
final
int
timestamp
)
{
if
(!
mBinaryDictionary
.
addNgramEntry
(
prevWordsInfo
,
word
,
frequency
,
timestamp
))
{
Log
.
e
(
TAG
,
"Cannot add n-gram entry."
);
Log
.
e
(
TAG
,
" PrevWordsInfo: "
+
prevWordsInfo
);
Log
.
e
(
TAG
,
" word: "
+
word
);
if
(
DEBUG
)
{
Log
.
i
(
TAG
,
"Cannot add n-gram entry."
);
Log
.
i
(
TAG
,
" PrevWordsInfo: "
+
prevWordsInfo
+
", word: "
+
word
);
}
}
}
/**
* Dynamically remove the n-gram entry in the dictionary.
*/
public
void
removeNgramDynamically
(
final
PrevWordsInfo
prevWordsInfo
,
final
String
word
1
)
{
public
void
removeNgramDynamically
(
final
PrevWordsInfo
prevWordsInfo
,
final
String
word
)
{
reloadDictionaryIfRequired
();
asyncExecuteTaskWithWriteLock
(
new
Runnable
()
{
@Override
...
...
@@ -343,7 +345,12 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
return
;
}
runGCIfRequiredLocked
(
true
/* mindsBlockByGC */
);
mBinaryDictionary
.
removeNgramEntry
(
prevWordsInfo
,
word1
);
if
(!
mBinaryDictionary
.
removeNgramEntry
(
prevWordsInfo
,
word
))
{
if
(
DEBUG
)
{
Log
.
i
(
TAG
,
"Cannot remove n-gram entry."
);
Log
.
i
(
TAG
,
" PrevWordsInfo: "
+
prevWordsInfo
+
", word: "
+
word
);
}
}
}
});
}
...
...
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