24 #if !UCONFIG_NO_BREAK_ITERATION
38 struct RBBIDataHeader;
39 class RuleBasedBreakIteratorTables;
41 class RBBIDataWrapper;
43 class LanguageBreakEngine;
44 class UnhandledEngine;
45 struct RBBIStateTable;
173 #ifndef U_HIDE_INTERNAL_API
210 friend class RBBIRuleBuilder;
449 virtual int32_t
next(int32_t n);
690 virtual int32_t getBreakType()
const;
699 #ifndef U_HIDE_INTERNAL_API
718 int32_t handlePrevious(
const RBBIStateTable *statetable);
729 int32_t handleNext(
const RBBIStateTable *statetable);
733 #ifndef U_HIDE_INTERNAL_API
759 const LanguageBreakEngine *getLanguageBreakEngine(
UChar32 c);
764 void makeRuleStatusValid();
The BreakIterator class implements methods for finding the location of boundaries in text.
UBool operator!=(const BreakIterator &rhs) const
Returns the complement of the result of operator==.
Abstract class that defines an API for iteration on text objects.
A subclass of BreakIterator whose behavior is specified using a list of rules.
virtual void adoptText(CharacterIterator *newText)
Set the iterator to analyze a new piece of text.
int32_t fLastRuleStatusIndex
Index of the Rule {tag} values for the most recent match.
UBool operator!=(const BreakIterator &that) const
Not-equal operator.
virtual int32_t following(int32_t offset)
Sets the iterator to refer to the first boundary position following the specified position.
virtual int32_t next(int32_t n)
Advances the iterator either forward or backward the specified number of steps.
RuleBasedBreakIterator(const uint8_t *compiledRules, uint32_t ruleLength, UErrorCode &status)
Contruct a RuleBasedBreakIterator from a set of precompiled binary rules.
virtual int32_t next(void)
Advances the iterator to the next boundary position.
virtual const uint8_t * getBinaryRules(uint32_t &length)
Return the binary form of compiled break rules, which can then be used to create a new break iterator...
RuleBasedBreakIterator(UDataMemory *image, UErrorCode &status)
This constructor uses the udata interface to create a BreakIterator whose internal tables live in a m...
RuleBasedBreakIterator(const RBBIDataHeader *data, enum EDontAdopt dontAdopt, UErrorCode &status)
Constructor from a flattened set of RBBI data in memory which need not be malloced (e....
virtual UBool operator==(const BreakIterator &that) const
Equality operator.
virtual int32_t current(void) const
Returns the current iteration position.
virtual void setText(const UnicodeString &newText)
Set the iterator to analyze a new piece of text.
virtual const UnicodeString & getRules(void) const
Returns the description used to create this iterator.
virtual BreakIterator * createBufferClone(void *stackBuffer, int32_t &BufferSize, UErrorCode &status)
Deprecated functionality.
UText * fText
The UText through which this BreakIterator accesses the text.
virtual int32_t first(void)
Sets the current iteration position to the beginning of the text, position zero.
virtual void reset(void)
Dumps caches and performs other actions associated with a complete change in text or iteration positi...
int32_t * fCachedBreakPositions
When a range of characters is divided up using the dictionary, the break positions that are discovere...
int32_t fPositionInCache
if fCachedBreakPositions is not null, this indicates which item in the cache the current iteration po...
UnhandledEngine * fUnhandledBreakEngine
If present, the special LanguageBreakEngine used for handling characters that are in the dictionary s...
UBool fLastStatusIndexValid
Rule tag value valid flag.
uint32_t fDictionaryCharCount
Counter for the number of characters encountered with the "dictionary" flag set.
int32_t checkDictionary(int32_t startPos, int32_t endPos, UBool reverse)
This is the function that actually implements dictionary-based breaking.
virtual BreakIterator * clone() const
Returns a newly-constructed RuleBasedBreakIterator with the same behavior, and iterating over the sam...
virtual UClassID getDynamicClassID(void) const
Returns a unique class ID POLYMORPHICALLY.
virtual int32_t getRuleStatusVec(int32_t *fillInVec, int32_t capacity, UErrorCode &status)
Get the status (tag) values from the break rule(s) that determined the most recently returned break p...
RuleBasedBreakIterator(const UnicodeString &rules, UParseError &parseError, UErrorCode &status)
Construct a RuleBasedBreakIterator from a set of rules supplied as a string.
virtual int32_t previous(void)
Moves the iterator backwards, to the last boundary preceding this one.
EDontAdopt
Constant to be used in the constructor RuleBasedBreakIterator(RBBIDataHeader*, EDontAdopt,...
RBBIDataWrapper * fData
The rule data for this BreakIterator instance.
RuleBasedBreakIterator(RBBIDataHeader *data, UErrorCode &status)
Constructor from a flattened set of RBBI data in malloced memory.
virtual UText * getUText(UText *fillIn, UErrorCode &status) const
Get a UText for the text being analyzed.
StringCharacterIterator * fSCharIter
When the input text is provided by a UnicodeString, this will point to a characterIterator that wraps...
virtual int32_t last(void)
Sets the current iteration position to the end of the text.
RuleBasedBreakIterator(const RuleBasedBreakIterator &that)
Copy constructor.
RuleBasedBreakIterator()
Default constructor.
virtual UBool isBoundary(int32_t offset)
Returns true if the specfied position is a boundary position.
UCharCharacterIterator * fDCharIter
When the input text is provided by a UText, this dummy CharacterIterator over an empty string will be...
virtual int32_t hashCode(void) const
Compute a hash code for this BreakIterator.
virtual CharacterIterator & getText(void) const
RuleBasedBreakIterator & operator=(const RuleBasedBreakIterator &that)
Assignment operator.
void init()
Common initialization function, used by constructors and bufferClone.
static UClassID getStaticClassID(void)
Returns the class ID for this class.
virtual void setBreakType(int32_t type)
Set the type of the break iterator.
virtual RuleBasedBreakIterator & refreshInputText(UText *input, UErrorCode &status)
Set the subject text string upon which the break iterator is operating without changing any other asp...
CharacterIterator * fCharIter
A character iterator that refers to the same text as the UText, above.
int32_t fNumCachedBreakPositions
The number of elements in fCachedBreakPositions.
virtual int32_t getRuleStatus() const
Return the status tag from the break rule that determined the most recently returned break position.
virtual void setText(UText *text, UErrorCode &status)
Reset the break iterator to operate over the text represented by the UText.
int32_t fBreakType
The type of the break iterator, or -1 if it has not been set.
virtual int32_t preceding(int32_t offset)
Sets the iterator to refer to the last boundary position before the specified position.
UStack * fLanguageBreakEngines
If present, UStack of LanguageBreakEngine objects that might handle dictionary characters.
virtual ~RuleBasedBreakIterator()
Destructor.
A concrete subclass of CharacterIterator that iterates over the characters (code units or code points...
A concrete subclass of CharacterIterator that iterates over the characters (code units or code points...
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
C API: Parse Error Information.
C++ API: String Character Iterator.
A UParseError struct is used to returned detailed information about parsing errors.
C++ API: UChar Character Iterator.
C API: Data loading interface.
struct UDataMemory UDataMemory
Forward declaration of the data memory type.
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
int8_t UBool
The ICU boolean type.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.