Logo Search packages:      
Sourcecode: icu version File versions  Download package

TransliterationRule Class Reference

#include <rbt_rule.h>

Inheritance diagram for TransliterationRule:


List of all members.

Detailed Description

A transliteration rule used by RuleBasedTransliterator. TransliterationRule is an immutable object.

A rule consists of an input pattern and an output string. When the input pattern is matched, the output string is emitted. The input pattern consists of zero or more characters which are matched exactly (the key) and optional context. Context must match if it is specified. Context may be specified before the key, after the key, or both. The key, preceding context, and following context may contain variables. Variables represent a set of Unicode characters, such as the letters a through z. Variables are detected by looking up each character in a supplied variable list to see if it has been so defined.

A rule may contain segments in its input string and segment references in its output string. A segment is a substring of the input pattern, indicated by an offset and limit. The segment may be in the preceding or following context. It may not span a context boundary. A segment reference is a special character in the output string that causes a segment of the input string (not the input pattern) to be copied to the output string. The range of special characters that represent segment references is defined by RuleBasedTransliterator.Data.

Alan Liu

Definition at line 55 of file rbt_rule.h.

Public Member Functions

void addSourceSetTo (UnicodeSet &toUnionTo) const
void addTargetSetTo (UnicodeSet &toUnionTo) const
virtual int32_t getContextLength (void) const
int16_t getIndexValue () const
virtual UBool masks (const TransliterationRule &r2) const
UMatchDegree matchAndReplace (Replaceable &text, UTransPosition &pos, UBool incremental) const
UBool matchesIndexValue (uint8_t v) const
void setData (const TransliterationRuleData *data)
virtual UnicodeStringtoRule (UnicodeString &pat, UBool escapeUnprintable) const
 TransliterationRule (TransliterationRule &other)
 TransliterationRule (const UnicodeString &input, int32_t anteContextPos, int32_t postContextPos, const UnicodeString &outputStr, int32_t cursorPosition, int32_t cursorOffset, UnicodeFunctor **segs, int32_t segsCount, UBool anchorStart, UBool anchorEnd, const TransliterationRuleData *data, UErrorCode &status)
virtual ~TransliterationRule ()

Static Public Member Functions

static void U_EXPORT2 operator delete (void *, void *) U_NO_THROW
static void U_EXPORT2 operator delete (void *p) U_NO_THROW
static void U_EXPORT2 operator delete[] (void *p) U_NO_THROW
static void *U_EXPORT2 operator new (size_t, void *ptr) U_NO_THROW
static void *U_EXPORT2 operator new (size_t size) U_NO_THROW
static void *U_EXPORT2 operator new[] (size_t size) U_NO_THROW

Private Types

enum  { ANCHOR_START = 1, ANCHOR_END = 2 }

Private Member Functions

TransliterationRuleoperator= (const TransliterationRule &other)

Private Attributes

int32_t anteContextLength
const TransliterationRuleDatadata
int8_t flags
int32_t keyLength
UnicodeString pattern
UnicodeFunctor ** segments
int32_t segmentsCount


class StringMatcher

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

Generated by  Doxygen 1.6.0   Back to index