Meaning of "←←←" (triple left arrow) in RBNF?

4 views
Skip to first unread message

Ben Golightly

unread,
Feb 24, 2023, 12:08:16 PM2/24/23
to CLDR Users Public Mail List
Hello CLDR Users,

I am working, in a personal capacity, on improved CLDR support for the Go programming language. Currently I am working on implementing Rule-Based Number Formatting (see Unicode Technical Standard #35: Unicode Locale Data Markup Language (LDML) Part 3.6). The rules are a translation of rules documented only at these ICU docs.

Normally, a substitution descriptor appears between two substitution token characters such as "→%example→" or "→→" (empty). There are also triple right arrows "→→→", which only seem to appear at the end of a rule body, with no descriptor.

I've also seen triple left arrows, which aren't documented anywhere. What does "←%foo←←" mean?

In CLDR 41.0, this type of rule appears in rbnf/ky.xml once, and in rbnf/pl.xml nine times.

This type of rule appears only in exactly three forms:

"←%spellout-cardinal-masculine←←;"
"←%%spellout-fraction-digits←←;"
"0* ←#,##0←←;"

Any hints greatly appreciated. Many thanks.

Kind regards

Ben

Steven R. Loomis

unread,
Feb 24, 2023, 12:29:09 PM2/24/23
to Ben Golightly, CLDR Users Public Mail List
Ben,
Can you file a bug? I think these docs really should move out of ICU and into CLDR.

As to your specific questions, just looking at the docs, seeing that < and > are mapped to ← and → :

→→→
- in normal rule : Divide the number by the rule's divisor and format the remainder, but bypass the normal rule-selection process and just use the rule that precedes this one in this rule list.
- in all other rules Not allowed.

so for Japanese ja.xml

<ruleset type="spellout-numbering-year-digits" access="private">
<rbnfrule value="0">=%spellout-numbering=;</rbnfrule>
<rbnfrule value="10">←←→→→;</rbnfrule>
<rbnfrule value="100">←←→→→;</rbnfrule>
<rbnfrule value="1000">←←→→→;</rbnfrule>
</ruleset>

if you have “1234” then you start with the 1000 rule,
perform “←←” (1234÷1000 = 1 R 234) so format “1”
then perform →→→ which means to continue with the prior rule (the ‘100’) with the remainder (234).
Then we have the “100” rule with the same content, so 234÷100=2R34 so format “2” and proceed with the prior rule at 34…


hope this helps.

--
Steven R. Loomis
Code Hive Tx, LLC
https://codehivetx.us
> --
> You received this message because you are subscribed to the Google Groups "CLDR Users Public Mail List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cldr-users+...@unicode.org.
> To view this discussion on the web visit https://groups.google.com/a/unicode.org/d/msgid/cldr-users/d3e24d76-c1a8-44cd-8b40-bd0d1bd63186n%40unicode.org.

Reply all
Reply to author
Forward
0 new messages