Unicode.Transform.Engine (Unicode Transform v1.1.0)

Copy Markdown View Source

Executes compiled transforms against input strings.

The engine implements a cursor-based rewriting algorithm following the ICU transliterator design:

  1. For each pass of conversion rules, walk the string from left to right.

  2. At each cursor position, try each rule in order.

  3. When a rule matches, replace the matched text and advance the cursor.

  4. If no rule matches, advance the cursor by one codepoint.

  5. Transform rules are applied to the entire string between passes.

The engine operates at the codepoint level (not grapheme level) because transforms need to process combining marks separately from base characters.

Summary

Functions

Executes a compiled transform on a string.

Functions

execute(string, compiled_transform)

Executes a compiled transform on a string.

Arguments

  • string — the input string.

  • compiled — a compiled transform struct.

Returns

The transformed string.