ICU-13447 RBBI: getRuleStatus() behavior, incorporate review comments, clarifying comments and API description.

X-SVN-Rev: 41024
This commit is contained in:
Andy Heninger 2018-03-01 00:38:41 +00:00
parent c2bb9c7523
commit c589ea8b5d
3 changed files with 11 additions and 1 deletions

View File

@ -478,6 +478,9 @@ public:
* position from <code>next()</code>, <code>previous()</code>, or
* any other break iterator functions that returns a boundary position.
* <p>
* Note that <code>getRuleStatus()</code> returns the value corresponding to
* <code>current()</code> index even after <code>next()</code> has returned DONE.
* <p>
* When creating custom break rules, one is free to define whatever
* status values may be convenient for the application.
* <p>

View File

@ -4519,6 +4519,9 @@ void RBBITest::TestTableRedundancies() {
}
}
// Bug 13447: verify that getRuleStatus() returns the value corresponding to current(),
// even after next() has returned DONE.
void RBBITest::TestBug13447() {
UErrorCode status = U_ZERO_ERROR;
LocalPointer<RuleBasedBreakIterator> bi(

View File

@ -529,7 +529,7 @@ public class RuleBasedBreakIterator extends BreakIterator {
}
/**
* Returns the current iteration position. Note that UBRK_DONE is never
* Returns the current iteration position. Note that DONE is never
* returned from this function; if iteration has run to the end of a
* string, current() will return the length of the string while
* next() will return BreakIterator.DONE).
@ -558,6 +558,10 @@ public class RuleBasedBreakIterator extends BreakIterator {
* position from <code>next()</code>, <code>previous()</code>, or
* any other break iterator functions that returns a boundary position.
* <p>
* Note that <code>getRuleStatus()</code> returns the value corresponding to
* <code>current()</code> index even after <code>next()</code> has returned DONE.
* <p>
* @return the status from the break rule that determined the boundary
* at the current iteration position.
*