aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/utils/char_utils.h
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-06-24 05:41:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-06-24 01:59:00 +0000
commit702e153fbc28d54aeb2ded40b9f3f31c1fd154e9 (patch)
tree9752f80961ebc343a277246925255f6c6e988415 /native/jni/src/utils/char_utils.h
parentd700e5970049deee7f61aeb573ef42d7caa6ab0f (diff)
parent88fa47a27d45f6460971d0d223aa558e121b3478 (diff)
downloadlatinime-702e153fbc28d54aeb2ded40b9f3f31c1fd154e9.tar.gz
latinime-702e153fbc28d54aeb2ded40b9f3f31c1fd154e9.tar.xz
latinime-702e153fbc28d54aeb2ded40b9f3f31c1fd154e9.zip
Merge "Support migration/dump of Beginning-of-Sentence entries."
Diffstat (limited to 'native/jni/src/utils/char_utils.h')
-rw-r--r--native/jni/src/utils/char_utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/native/jni/src/utils/char_utils.h b/native/jni/src/utils/char_utils.h
index f28ed5682..63786502b 100644
--- a/native/jni/src/utils/char_utils.h
+++ b/native/jni/src/utils/char_utils.h
@@ -98,6 +98,10 @@ class CharUtils {
// Beginning-of-Sentence.
static AK_FORCE_INLINE int attachBeginningOfSentenceMarker(int *const codePoints,
const int codePointCount, const int maxCodePoint) {
+ if (codePointCount > 0 && codePoints[0] == CODE_POINT_BEGINNING_OF_SENTENCE) {
+ // Marker has already been attached.
+ return codePointCount;
+ }
if (codePointCount >= maxCodePoint) {
// the code points cannot be marked as a Beginning-of-Sentence.
return 0;