Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1343)

Unified Diff: base/i18n/break_iterator.cc

Issue 1272683002: Creates BreakIterator::GetWordBreakStatus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/i18n/break_iterator.cc
diff --git a/base/i18n/break_iterator.cc b/base/i18n/break_iterator.cc
index e2ed667572f52d8b033cb9899186d73852846755..2faf9fc3d972d080d43a80ad4bd43e5df9204d3c 100644
--- a/base/i18n/break_iterator.cc
+++ b/base/i18n/break_iterator.cc
@@ -144,6 +144,15 @@ bool BreakIterator::IsWord() const {
return status != UBRK_WORD_NONE;
}
+BreakIterator::WordBreakStatus BreakIterator::IsWordBreak() const {
+ if (break_type_ != BREAK_WORD && break_type_ != RULE_BASED)
+ return IS_NOT_WORD_BREAK;
+ return ubrk_getRuleStatus(static_cast<UBreakIterator*>(iter_)) ==
+ UBRK_WORD_NONE
+ ? IS_SKIPPABLE_WORD
+ : IS_WORD_BREAK;
+}
+
bool BreakIterator::IsEndOfWord(size_t position) const {
if (break_type_ != BREAK_WORD && break_type_ != RULE_BASED)
return false;

Powered by Google App Engine
This is Rietveld 408576698