Add DEBUG_DUMP to ContactsBinaryDictionary.

Change-Id: Iebfae5f37727deeb6636ad6301b7b1bbe5f454e0
This commit is contained in:
Keisuke Kuroyanagi 2013-11-20 14:07:44 +09:00
parent 994530d9bd
commit dd0da393e1

View file

@ -44,7 +44,8 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary {
private static final String TAG = ContactsBinaryDictionary.class.getSimpleName();
private static final String NAME = "contacts";
private static boolean DEBUG = false;
private static final boolean DEBUG = false;
private static final boolean DEBUG_DUMP = false;
/**
* Frequency for contacts information into the dictionary
@ -168,6 +169,10 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary {
if (isValidName(name)) {
addName(name);
++count;
} else {
if (DEBUG_DUMP) {
Log.d(TAG, "Invalid name: " + name);
}
}
cursor.moveToNext();
}
@ -204,6 +209,9 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary {
if (Character.isLetter(name.codePointAt(i))) {
int end = getWordEndPosition(name, len, i);
String word = name.substring(i, end);
if (DEBUG_DUMP) {
Log.d(TAG, "addName word = " + word);
}
i = end - 1;
// Don't add single letter words, possibly confuses
// capitalization of i.