From d4206fa2e5804ab13f75049c85687935ad617423 Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Tue, 5 Dec 2017 22:56:31 +0000 Subject: [PATCH] ICU-13447 Document RBBI: getRuleStatus() behavior when going past the end of the input text. X-SVN-Rev: 40700 --- icu4c/source/common/unicode/brkiter.h | 13 ++++++------ icu4c/source/common/unicode/rbbi.h | 21 +++++++------------ .../src/com/ibm/icu/text/BreakIterator.java | 11 +++++----- .../ibm/icu/text/RuleBasedBreakIterator.java | 16 +++++++------- 4 files changed, 27 insertions(+), 34 deletions(-) diff --git a/icu4c/source/common/unicode/brkiter.h b/icu4c/source/common/unicode/brkiter.h index c64bb712222..77d7a85fa81 100644 --- a/icu4c/source/common/unicode/brkiter.h +++ b/icu4c/source/common/unicode/brkiter.h @@ -298,15 +298,14 @@ public: virtual int32_t next(int32_t n) = 0; /** - * For RuleBasedBreakIterators, return the status tag from the - * break rule that determined the most recently - * returned break position. + * For RuleBasedBreakIterators, return the status tag from the break rule + * that determined the boundary at the current iteration position. *

* For break iterator types that do not support a rule status, * a default value of 0 is returned. *

- * @return the status from the break rule that determined the most recently - * returned break position. + * @return the status from the break rule that determined the boundary at + * the current iteration position. * @see RuleBaseBreakIterator::getRuleStatus() * @see UWordBreak * @stable ICU 52 @@ -315,7 +314,7 @@ public: /** * For RuleBasedBreakIterators, get the status (tag) values from the break rule(s) - * that determined the most recently returned break position. + * that determined the boundary at the current iteration position. *

* For break iterator types that do not support rule status, * no values are returned. @@ -334,7 +333,7 @@ public: * normal way, without attempting to store any values. * @param status receives error codes. * @return The number of rule status values from rules that determined - * the most recent boundary returned by the break iterator. + * the boundary at the current iteration position. * In the event of a U_BUFFER_OVERFLOW_ERROR, the return value * is the total number of status values that were available, * not the reduced number that were actually returned. diff --git a/icu4c/source/common/unicode/rbbi.h b/icu4c/source/common/unicode/rbbi.h index 521e502f119..a0c1f90415c 100644 --- a/icu4c/source/common/unicode/rbbi.h +++ b/icu4c/source/common/unicode/rbbi.h @@ -471,8 +471,8 @@ public: /** - * Return the status tag from the break rule that determined the most recently - * returned break position. For break rules that do not specify a + * Return the status tag from the break rule that determined the boundary at + * the current iteration position. For break rules that do not specify a * status, a default value of 0 is returned. If more than one break rule * would cause a boundary to be located at some position in the text, * the numerically largest of the applicable status values is returned. @@ -492,13 +492,8 @@ public: * When creating custom break rules, one is free to define whatever * status values may be convenient for the application. *

- * Note: this function is not thread safe. It should not have been - * declared const, and the const remains only for compatibility - * reasons. (The function is logically const, but not bit-wise const). - * TODO: check this. Probably thread safe now. - *

- * @return the status from the break rule that determined the most recently - * returned break position. + * @return the status from the break rule that determined the boundary + * at the current iteration position. * * @see UWordBreak * @stable ICU 2.2 @@ -506,8 +501,8 @@ public: virtual int32_t getRuleStatus() const; /** - * Get the status (tag) values from the break rule(s) that determined the most - * recently returned break position. + * Get the status (tag) values from the break rule(s) that determined the boundary + * at the current iteration position. *

* The returned status value(s) are stored into an array provided by the caller. * The values are stored in sorted (ascending) order. @@ -520,8 +515,8 @@ public: * the function to return the number of status values, in the * normal way, without attemtping to store any values. * @param status receives error codes. - * @return The number of rule status values from rules that determined - * the most recent boundary returned by the break iterator. + * @return The number of rule status values from the rules that determined + * the boundary at the current iteration position. * In the event of a U_BUFFER_OVERFLOW_ERROR, the return value * is the total number of status values that were available, * not the reduced number that were actually returned. diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/BreakIterator.java b/icu4j/main/classes/core/src/com/ibm/icu/text/BreakIterator.java index 451b8c0ea76..67f6048eecc 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/BreakIterator.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/BreakIterator.java @@ -445,14 +445,13 @@ public abstract class BreakIterator implements Cloneable /** * For RuleBasedBreakIterators, return the status tag from the - * break rule that determined the most recently - * returned break position. + * break rule that determined the boundary at the current iteration position. *

* For break iterator types that do not support a rule status, * a default value of 0 is returned. *

- * @return The status from the break rule that determined the most recently - * returned break position. + * @return The status from the break rule that determined the boundary + * at the current iteration position. * * @stable ICU 52 */ @@ -463,7 +462,7 @@ public abstract class BreakIterator implements Cloneable /** * For RuleBasedBreakIterators, get the status (tag) values from the break rule(s) - * that determined the most recently returned break position. + * that determined the the boundary at the current iteration position. *

* For break iterator types that do not support rule status, * no values are returned. @@ -474,7 +473,7 @@ public abstract class BreakIterator implements Cloneable * * @param fillInArray an array to be filled in with the status values. * @return The number of rule status values from rules that determined - * the most recent boundary returned by the break iterator. + * the the boundary at the current iteration position. * In the event that the array is too small, the return value * is the total number of status values that were available, * not the reduced number that were actually returned. diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java b/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java index 28286ec9751..b39aad503db 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java @@ -546,8 +546,8 @@ public class RuleBasedBreakIterator extends BreakIterator { /** - * Return the status tag from the break rule that determined the most recently - * returned break position. The values appear in the rule source + * Return the status tag from the break rule that determined the boundary at + * the current iteration position. The values appear in the rule source * within brackets, {123}, for example. For rules that do not specify a * status, a default value of 0 is returned. If more than one rule applies, * the numerically largest of the possible status values is returned. @@ -561,8 +561,8 @@ public class RuleBasedBreakIterator extends BreakIterator { * position from next(), previous(), or * any other break iterator functions that returns a boundary position. *

- * @return the status from the break rule that determined the most recently - * returned break position. + * @return the status from the break rule that determined the boundary + * at the current iteration position. * * @stable ICU 60 */ @@ -583,8 +583,8 @@ public class RuleBasedBreakIterator extends BreakIterator { } /** - * Get the status (tag) values from the break rule(s) that determined the most - * recently returned break position. The values appear in the rule source + * Get the status (tag) values from the break rule(s) that determined the boundary + * at the current iteration position. The values appear in the rule source * within brackets, {123}, for example. The default status value for rules * that do not explicitly provide one is zero. *

@@ -596,8 +596,8 @@ public class RuleBasedBreakIterator extends BreakIterator { * will be thrown. * * @param fillInArray an array to be filled in with the status values. - * @return The number of rule status values from rules that determined - * the most recent boundary returned by the break iterator. + * @return The number of rule status values from the rules that determined + * the boundary at the current iteration position. * In the event that the array is too small, the return value * is the total number of status values that were available, * not the reduced number that were actually returned. -- 2.40.0