am 1a9d1782: Merge "Add DEBUG_DUMP to ContactsBinaryDictionary."
* commit '1a9d1782633b68a42df08535a5ea34c5bd92459f': Add DEBUG_DUMP to ContactsBinaryDictionary.main
commit
d711a147e3
|
@ -44,7 +44,8 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary {
|
||||||
private static final String TAG = ContactsBinaryDictionary.class.getSimpleName();
|
private static final String TAG = ContactsBinaryDictionary.class.getSimpleName();
|
||||||
private static final String NAME = "contacts";
|
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
|
* Frequency for contacts information into the dictionary
|
||||||
|
@ -168,6 +169,10 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary {
|
||||||
if (isValidName(name)) {
|
if (isValidName(name)) {
|
||||||
addName(name);
|
addName(name);
|
||||||
++count;
|
++count;
|
||||||
|
} else {
|
||||||
|
if (DEBUG_DUMP) {
|
||||||
|
Log.d(TAG, "Invalid name: " + name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cursor.moveToNext();
|
cursor.moveToNext();
|
||||||
}
|
}
|
||||||
|
@ -204,6 +209,9 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary {
|
||||||
if (Character.isLetter(name.codePointAt(i))) {
|
if (Character.isLetter(name.codePointAt(i))) {
|
||||||
int end = getWordEndPosition(name, len, i);
|
int end = getWordEndPosition(name, len, i);
|
||||||
String word = name.substring(i, end);
|
String word = name.substring(i, end);
|
||||||
|
if (DEBUG_DUMP) {
|
||||||
|
Log.d(TAG, "addName word = " + word);
|
||||||
|
}
|
||||||
i = end - 1;
|
i = end - 1;
|
||||||
// Don't add single letter words, possibly confuses
|
// Don't add single letter words, possibly confuses
|
||||||
// capitalization of i.
|
// capitalization of i.
|
||||||
|
|
Loading…
Reference in New Issue