From 9351550dc6af7859e5280e16144c9386a37b976d Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Sun, 31 Jul 2011 11:28:15 +0900 Subject: Clean up revertLastWord() The "deleteChar" argument of this method is acutally always true in the current code path. Also, in this method, textToTheLeft virtually never has a punctuation letter as its initial character. This change is one of preparatory changes for bug:4983945. Change-Id: I531a32570a35634c21c1d74b2b461e40a1b7f660 --- java/src/com/android/inputmethod/latin/Utils.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'java/src/com/android/inputmethod/latin/Utils.java') diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java index 23ef1a03c..16a2b0e5f 100644 --- a/java/src/com/android/inputmethod/latin/Utils.java +++ b/java/src/com/android/inputmethod/latin/Utils.java @@ -190,6 +190,18 @@ public class Utils { } } + public static boolean canBeFollowedByPeriod(final int codePoint) { + // TODO: Check again whether there really ain't a better way to check this. + // TODO: This should probably be language-dependant... + return Character.isLetterOrDigit(codePoint) + || codePoint == Keyboard.CODE_SINGLE_QUOTE + || codePoint == Keyboard.CODE_DOUBLE_QUOTE + || codePoint == Keyboard.CODE_CLOSING_PARENTHESIS + || codePoint == Keyboard.CODE_CLOSING_SQUARE_BRACKET + || codePoint == Keyboard.CODE_CLOSING_CURLY_BRACKET + || codePoint == Keyboard.CODE_CLOSING_ANGLE_BRACKET; + } + /* package */ static class RingCharBuffer { private static RingCharBuffer sRingCharBuffer = new RingCharBuffer(); private static final char PLACEHOLDER_DELIMITER_CHAR = '\uFFFC'; -- cgit v1.2.3-83-g751a