Dear ICU team & users,
I would like to propose the following RBNF syntax change for: ICU 77
Please provide feedback by: 2024-1-15
Designated API reviewer: Volunteers are welcome
This proposal only affects the documentation and RBNF syntax.
I’d like to extend the RBNF syntax to support more complex grammar. I’d like to change the omission rule with square brackets. By default, everything between the square brackets are omitted when the remainder is 0. My proposal will not change this behavior by default, unless a “|” (pipe symbol) is present between the square brackets. You can think of it performing like an else statement. Everything between the beginning square bracket and the pipe acts as it currently does. Everything between the pipe symbol and the end square bracket will be used instead of omitting the text.
This behavior is important for supporting large ordinals in slavic languages. It’s convenient for other languages, like English.
The test case in the prototype and the ticket provides more examples of the change. Below is a simplified example of the new syntax. Right now, we have the following ordinals in English.
%%tieth:
0: tieth;
1: ty-=%spellout-ordinal=;
%spellout-ordinal:
...
20: twen>%%tieth>;
30: thir>%%tieth>;
40: for>%%tieth>;
50: fif>%%tieth>;
That could be simplified to the following rules instead.
%spellout-ordinal:
...
20: twent[y->>|ieth];
30: thirt[y->>|ieth];
40: fort[y->>|ieth];
50: fift[y->>|ieth];
The cardinal and ordinal rules will work on either side of the pipe symbol.
I plan to port these changes from ICU4J to ICU4C before creating a pull request. Once a released version of ICU starts supporting this syntax, the CLDR rules will be able to adopt this new syntax for the languages that need it.
Sincerely,
George