ICU 75.1 75.1

Public Member Functions
icu::ExternalBreakEngine Class Referenceabstract

The ExternalBreakEngine class define an abstract interface for the host environment to provide a low level facility to break text for unicode text in script that the text boundary cannot be handled by upper level rule based logic, for example, for Chinese and Japanese word breaking, Thai, Khmer, Burmese, Lao and other Southeast Asian scripts. More...

`#include <rbbi.h>`

Inheritance diagram for icu::ExternalBreakEngine:

## Public Member Functions
virtual | ~ExternalBreakEngine ()
| destructor More...
virtual bool | isFor (UChar32 c, const char *locale) const =0
virtual bool | handles (UChar32 c) const =0
virtual int32_t | fillBreaks (UText *text, int32_t start, int32_t end, int32_t *foundBreaks, int32_t foundBreaksCapacity, UErrorCode &status) const =0
Public Member Functions inherited from icu::UObject
virtual | ~UObject ()
| Destructor. More...
virtual UClassID | getDynamicClassID () const
| ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class. More...

## Detailed Description

The ExternalBreakEngine class define an abstract interface for the host environment to provide a low level facility to break text for unicode text in script that the text boundary cannot be handled by upper level rule based logic, for example, for Chinese and Japanese word breaking, Thai, Khmer, Burmese, Lao and other Southeast Asian scripts.

The host environment implement one or more subclass of ExternalBreakEngine and register them in the initialization time by calling RuleBasedBreakIterator::registerExternalBreakEngine(). ICU adopt and own the engine and will delete the registered external engine in proper time during the clean up event.

Internal:
  Do not use. This API is for internal use only. ICU 74 technology preview

Definition at line 60 of file rbbi.h.

## Constructor & Destructor Documentation

## ◆ ~ExternalBreakEngine()

virtual icu::ExternalBreakEngine::~ExternalBreakEngine | ( |  | ) |
| inline virtual

destructor

Internal:
  Do not use.

This API is for internal use only. ICU 74 technology preview

Definition at line 66 of file rbbi.h.

## Member Function Documentation

## ◆ fillBreaks()

virtual int32_t icu::ExternalBreakEngine::fillBreaks | ( | UText * | text,
|  | int32_t | start,
|  | int32_t | end,
|  | int32_t * | foundBreaks,
|  | int32_t | foundBreaksCapacity,
|  | UErrorCode & | status
| ) |  | const
| pure virtual

Divide up a range of text handled by this break engine.

Parameters

  text | A UText representing the text
  start | The start of the range of known characters
  end | The end of the range of known characters
  foundBreaks | Output of C array of int32_t break positions, or nullptr
  foundBreaksCapacity | The capacity of foundBreaks
  status | Information on any errors encountered.

Returns
  The number of breaks found

Internal:
  Do not use. This API is for internal use only. ICU 74 technology preview

## ◆ handles()

virtual bool icu::ExternalBreakEngine::handles | ( | UChar32 | c | ) | const
| pure virtual

Indicate whether this engine handles a particular character.This method is used by the RuleBasedBreakIterator after it already find a break engine to see which characters after the first one can be handled by this break engine.

Parameters

  c | A character that the engine might handle.

Returns
  true if this engine handles the particular character.

Internal:
  Do not use. This API is for internal use only. ICU 74 technology preview

## ◆ isFor()

virtual bool icu::ExternalBreakEngine::isFor | ( | UChar32 | c,
|  | const char * | locale
| ) |  | const
| pure virtual

Indicate whether this engine handles a particular character when the RuleBasedBreakIterator is used for a particular locale. This method is used by the RuleBasedBreakIterator to find a break engine.

Parameters

  c | A character which begins a run that the engine might handle.
  locale | The locale.

Returns
  true if this engine handles the particular character for that locale.

Internal:
  Do not use. This API is for internal use only. ICU 74 technology preview

The documentation for this class was generated from the following file:

- common/unicode/rbbi.h