aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/ContactsDictionary.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-04-28 15:39:39 +0900
committerJean Chalard <jchalard@google.com>2011-05-02 19:19:05 +0900
commit0730bbfbf5e37bbcb5c287aeff71b304c833a36e (patch)
tree6fcbf0fd0382e23301b850b27232f4121f0dbd82 /java/src/com/android/inputmethod/latin/ContactsDictionary.java
parent3bf6fbb6b8765a90e19199e5dfeb7df26d04bb68 (diff)
downloadlatinime-0730bbfbf5e37bbcb5c287aeff71b304c833a36e.tar.gz
latinime-0730bbfbf5e37bbcb5c287aeff71b304c833a36e.tar.xz
latinime-0730bbfbf5e37bbcb5c287aeff71b304c833a36e.zip
Straighten out magic space vs real spaces behavior.
Picking a suggestion inserts a space after the word. This change makes this space a magic space. Incidentally, do some minor cleanup: add CODE_DASH, CODE_SINGLE_QUOTE and CODE_DOUBLE_QUOTE to Keyboard and use them throughout the code, and remove a useless import directive in some unrelated file. Bug: 4319740 Change-Id: I245f396c34dd0af820bca91edc4ec363238a4ae4
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ContactsDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/ContactsDictionary.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/ContactsDictionary.java b/java/src/com/android/inputmethod/latin/ContactsDictionary.java
index bdb68cac7..b057cf4e3 100644
--- a/java/src/com/android/inputmethod/latin/ContactsDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ContactsDictionary.java
@@ -26,6 +26,8 @@ import android.provider.ContactsContract.Contacts;
import android.text.TextUtils;
import android.util.Log;
+import com.android.inputmethod.keyboard.Keyboard;
+
public class ContactsDictionary extends ExpandableDictionary {
private static final String[] PROJECTION = {
@@ -123,8 +125,9 @@ public class ContactsDictionary extends ExpandableDictionary {
for (j = i + 1; j < len; j++) {
char c = name.charAt(j);
- if (!(c == '-' || c == '\'' ||
- Character.isLetter(c))) {
+ if (!(c == Keyboard.CODE_DASH
+ || c == Keyboard.CODE_SINGLE_QUOTE
+ || Character.isLetter(c))) {
break;
}
}