Loading java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java +2 −1 Original line number Diff line number Diff line Loading @@ -217,7 +217,8 @@ public final class CapsModeUtils { // a sentence. If it's neither, the only remaining case is the period so we get the opposite // case out of the way. if (c == Constants.CODE_QUESTION_MARK || c == Constants.CODE_EXCLAMATION_MARK) { return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_SENTENCES) & reqModes; return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_WORDS | TextUtils.CAP_MODE_SENTENCES) & reqModes; } if (!spacingAndPunctuations.isSentenceSeparator(c) || j <= 0) { return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_WORDS) & reqModes; Loading tests/src/com/android/inputmethod/latin/utils/CapsModeUtilsTests.java +12 −0 Original line number Diff line number Diff line Loading @@ -124,5 +124,17 @@ public class CapsModeUtilsTests extends AndroidTestCase { allPathsForCaps("Word. ", c | w, sp, false); // Armenian period : capitalize if MODE_SENTENCES allPathsForCaps("Word\u0589 ", c | w | s, sp, false); // Test for sentence terminators sp = job.runInLocale(res, Locale.ENGLISH); allPathsForCaps("Word? ", c | w | s, sp, false); allPathsForCaps("Word?", c | w | s, sp, true); allPathsForCaps("Word?", c, sp, false); allPathsForCaps("Word! ", c | w | s, sp, false); allPathsForCaps("Word!", c | w | s, sp, true); allPathsForCaps("Word!", c, sp, false); allPathsForCaps("Word; ", c | w, sp, false); allPathsForCaps("Word;", c | w, sp, true); allPathsForCaps("Word;", c, sp, false); } } Loading
java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java +2 −1 Original line number Diff line number Diff line Loading @@ -217,7 +217,8 @@ public final class CapsModeUtils { // a sentence. If it's neither, the only remaining case is the period so we get the opposite // case out of the way. if (c == Constants.CODE_QUESTION_MARK || c == Constants.CODE_EXCLAMATION_MARK) { return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_SENTENCES) & reqModes; return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_WORDS | TextUtils.CAP_MODE_SENTENCES) & reqModes; } if (!spacingAndPunctuations.isSentenceSeparator(c) || j <= 0) { return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_WORDS) & reqModes; Loading
tests/src/com/android/inputmethod/latin/utils/CapsModeUtilsTests.java +12 −0 Original line number Diff line number Diff line Loading @@ -124,5 +124,17 @@ public class CapsModeUtilsTests extends AndroidTestCase { allPathsForCaps("Word. ", c | w, sp, false); // Armenian period : capitalize if MODE_SENTENCES allPathsForCaps("Word\u0589 ", c | w | s, sp, false); // Test for sentence terminators sp = job.runInLocale(res, Locale.ENGLISH); allPathsForCaps("Word? ", c | w | s, sp, false); allPathsForCaps("Word?", c | w | s, sp, true); allPathsForCaps("Word?", c, sp, false); allPathsForCaps("Word! ", c | w | s, sp, false); allPathsForCaps("Word!", c | w | s, sp, true); allPathsForCaps("Word!", c, sp, false); allPathsForCaps("Word; ", c | w, sp, false); allPathsForCaps("Word;", c | w, sp, true); allPathsForCaps("Word;", c, sp, false); } }