Skip to main content

International Components for Unicode

Transform Rule Editor Help

The rule editor allows one to enter and modify transform rules. The rules are compiled into a new transform and may be saved for use in the main transform demo window.

How To Use The Editor

Enter the rules in the text area. When finished, press the Save or Save As... button. This will attempt to compile the rules. If there are any problems, an error message will be displayed at the bottom of the window. You can then correct the problem and try again.

To remove a rule set, select it in the pop-up list and press the Delete button.

Using New Rules

Once you have created and saved a new rule set, you may use it in the main window. To do so, select the rule in the main pop-up or type it into the compound ID field and select (Compound).

System Rules

System rules may be examined by selecting them in the pop-up list. They may then be modified and the modified version may be saved. You must select a new name to save the rules under.

The demo does not allow the system transforms themselves to be modified in order to minimize confusion. Whenever you load the rules for Latin-Greek, you are seeing the actual system rules, not some user's modification of them.

How To Write Rules

Each rule describes two patterns, an input pattern and an output pattern. When the input pattern is seen, it is transformed into the output pattern. The basic rule syntax is:

input > output ;  # comment

Each rule ends with a semicolon (;). The pound character (#) indicates that the rest of the line is a comment.

The input and output patterns may be simple text, for example:

a > A;  # make A's uppercase

More complicated patterns may be used to specify that certain text must be seen on the left or right; this text is called context, and it is matched, but not modified:

[0-9] {a} > A;  # make A's after digits uppercase

This description only covers the essentials. For more information about rules, please see the Transform Rule Tutorial of the ICU User Guide.