Skip to content

Commit 0480fed

Browse files
committed
Rewrote/rearranged the cjk "spoken out" styles.
1 parent 17f72ec commit 0480fed

1 file changed

Lines changed: 109 additions & 135 deletions

File tree

css3-lists/Overview.src.html

Lines changed: 109 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@ <h4 id='ethiopic-numeric'>
400400
</ol>
401401

402402
<p>This system is defined for all numbers greater than zero. For zero and
403-
negative numbers, the decimal system is used instead.</p>
403+
negative numbers, instead construct the representation of the counter value
404+
using the ''decimal'' style.</p>
404405

405406
<p>The suffix for the ethiopic-numeric numbering systems is a dot
406407
(. U+002E FULL STOP). <span class="issue">Is there a better suffix
@@ -423,54 +424,99 @@ <h4 id='ethiopic-numeric'>
423424
</div>
424425

425426
<h4 id='chinese-counter-styles'>
426-
The Chinese "spoken-out" counter styles</h4>
427-
428-
<p>The Chinese "spoken-out" counter styles define a style of numbering roughly
429-
similar to using "one, two, three..." in English. The "financial" variant
430-
is commonly used for writing out quantities of money, as it is somewhat difficult
431-
to modify one "financial" character into another. These styles are defined
432-
for all numbers between -10<sup>16</sup> and 10<sup>16</sup>, exclusive.
433-
There are four Chinese counter styles which are constructed using the same
434-
algorithm, but different sets of characters (given below). The following
435-
algorithm converts decimal digits into Chinese numbers:</p>
427+
The CJK "spoken-out" counter styles</h4>
428+
429+
<p>Chinese, Japanese, and Korean all share almost identical "spoken-out"
430+
counter styles, which are roughly similar to using "one, two, three..." in
431+
English. The Chinese and Japanese styles are defined for all numbers between
432+
-10<sup>16</sup> and 10<sup>16</sup>, exclusive; the Korean styles are
433+
defined for all non-negative numbers less than 10<sup>16</sup>. All of the
434+
styles are defined by almost identical algorithms (specified as a single
435+
algorithm here, with the differences called out when relevant), but use
436+
different sets of characters. The list following the algorithm gives the
437+
name of each counter style using this algorithm, and the individual character
438+
sets used by each style.</p>
439+
440+
<p>For legacy reasons, the counter style ''cjk-ideographic'' must be treated
441+
as an alias for ''trad-chinese-informal''.</p>
436442

437443
<ol>
438-
<li>If the counter value is 0, the representation is simply the character
439-
for 0 from the counter style's table, below. End this algorithm.</li>
440-
441-
<li>If the counter value is negative, set the <var>negative flag</var>
442-
and run the rest of this algorithm with the absolute value of the counter
443-
value.</li>
444-
445-
<li>Split the decimal number into groups of four digits, starting with
446-
the least significant digit.</li>
444+
<li>If the counter value is 0, the representation is the character for 0
445+
specified for the given counter style. Skip the rest of this algorithm.</li>
446+
447+
<li>For the Chinese and Japanese styles, if the counter value is negative,
448+
set the <var>negative flag</var> to true and run the rest of this algorithm
449+
with the absolute value of the counter value. <span class='note'>(The
450+
Korean styles cannot represent negative numbers, and so instead use the
451+
fallback style.)</span></li>
452+
453+
<li>Initially represent the counter value as a decimal number. Starting
454+
from the right (ones place), split the decimal number into groups of
455+
four digits.</li>
456+
457+
<li>For each group with a non-zero value, append the appropriate group
458+
marker to the group. The ones group has no marker.</li>
459+
460+
<li>Within each group, for each digit that is not 0, append the appropriate
461+
digit marker to the digit. The ones digit of each group has no marker.</li>
462+
463+
<li>Drop ones:
464+
<ul>
465+
<li>For the Chinese informal styles, for any group with a value
466+
between ten and nineteen, remove the tens digit (leave the digit
467+
marker).</li>
468+
469+
<li>For the Japanese informal and Korean informal styles, if any
470+
of the digit markers are preceded by the digit 1, and that digit
471+
is not the first digit of the group, remove the digit (leave the
472+
digit marker).</li>
473+
474+
<li>For Korean informal styles, if the value of the ten-thousands
475+
group is 1, drop the digit (leave the digit marker).</li>
476+
</ul>
477+
</li>
447478

448-
<li>Ignoring groups that have the value 0, append the second group marker
449-
to the second group, the third group marker to the third group, and the
450-
fourth group marker to the fourth group. The first group has no marker.</li>
479+
<li>Drop zeros:
480+
<ul>
481+
<li>For the Japanese and Korean styles, drop all zero digits.</li>
451482

452-
<li>For each group, ignoring digits that have the value 0, append the
453-
second digit marker to the second digit, the third digit marker to the
454-
third digit, and the fourth digit marker to the fourth digit. The first
455-
digit has no marker.</li>
483+
<li>For the Chinese informal styles, drop all groups with the
484+
value 0.</li>
456485

457-
<li>For each group, drop any trailing 0s. As well, drop any leading 0s
458-
for the largest group.</li>
486+
<li>For all Chinese styles, drop any trailing zeros for all
487+
non-zero groups and collapse (across groups) each remaining
488+
consecutive group of zeros into a single zero digit.</li>
489+
</ul>
490+
</li>
459491

460-
<li>Concatenate the groups back into a single string, least significant
461-
group first (on the right).</li>
492+
<li>Recombine groups:
493+
<ul>
494+
<li>For the Chinese and Japanese styles, concatenate the groups
495+
back into a single string, least significant group first (on the
496+
right).</li>
462497

463-
<li>Collapse any runs of consecutive 0s into a single 0.
464-
<span class=note>This can cross the previous group boundaries.</span></li>
498+
<li>For the Korean styles, concatenate the groups back into a
499+
single string, least significant group first (on the right), with
500+
a space (' ' U+0020) inserted between each group.</li>
501+
</ul>
502+
</li>
465503

466-
<li>Replace each digit with the relevant character from the counter style's
467-
table, below.</li>
504+
<li>If the <var>negative flag</var> was set to true earlier in the
505+
algorithm, prepend the appropriate negative sign for the given counter
506+
style to the string.</li>
468507

469-
<li>If the <var>negative flag</var> is set, prepend 負 U+8D1F to the string.</li>
508+
<li>Replace the digits 0-9 with the appropriate character for the given
509+
counter style. Return the resultant string as the representation of the
510+
counter value.</li>
470511
</ol>
471512

472-
<p>The following tables define the characers used in the four Chinese counter
473-
styles:</p>
513+
<p>For all of these counter styles, the suffix is "、" U+3001, the prefix is
514+
the empty string, the fallback style is ''decimal'', and the upper range
515+
bound is 9999 9999 9999 9999 (one less than 10<sup>16</sup>). For the Chinese
516+
and Japanese styles, the lower range bound is -9999 9999 9999 9999 (one more
517+
than -10<sup>16</sup>); for the Korean styles the lower range bound is 0.</p>
518+
519+
<p>The following tables define the characters used in these styles:</p>
474520

475521
<dl>
476522
<dt><dfn>simp-chinese-informal</dfn></dt>
@@ -530,11 +576,14 @@ <h4 id='chinese-counter-styles'>
530576
<tr>
531577
<td>Fourth Group Marker
532578
<td>万亿 U+4E07 U+4EBF
579+
<tr>
580+
<td>Negative Sign
581+
<td>負 U+8D1F
533582
</tbody>
534583
</table>
535584
</dd>
536585

537-
<dt><dfn>simp-chinese-financial</dfn></dt>
586+
<dt><dfn>simp-chinese-formal</dfn></dt>
538587
<dd>
539588
<table>
540589
<thead>
@@ -591,63 +640,19 @@ <h4 id='chinese-counter-styles'>
591640
<tr>
592641
<td>Fourth Group Marker
593642
<td>万亿 U+4E07 U+4EBF
643+
<tr>
644+
<td>Negative Sign
645+
<td>負 U+8D1F
594646
</tbody>
595647
</table>
596648
</dd>
597649

598650
<dt><dfn>trad-chinese-informal</dfn></dt>
599651
<dd class=issue>Fill this in.</dd>
600652

601-
<dt><dfn>trad-chinese-financial</dfn></dt>
653+
<dt><dfn>trad-chinese-formal</dfn></dt>
602654
<dd class=issue>Fill this in.</dd>
603-
</dl>
604-
605-
<p class=note>Note: Chinese, Japanese, and Korean spoken-out numbering (what
606-
this section defines) is actually defined up to 10<sup>72</sup>. Numbers
607-
higher than 10<sup>16</sup> are usually written in scientific notation,
608-
however, and there is some variation in the group markers used for such numbers,
609-
so the algorithm has been intentionally defined only to 10<sup>16</sup>.</p>
610-
611-
612-
<h4 id='japanese-counter-styles'>
613-
The Japanese "spoken-out" counter styles</h4>
614-
615-
<p>The Japanese "spoken-out" counter styles are similar to the
616-
<i title="chinese-counter-styles">Chinese "spoken-out" counter styles</i>,
617-
except that they use different characters, use a slightly different algorithm,
618-
and are not defined for negative numbers. The following algorithm converts
619-
decimal digits into Japanese numbers:</p>
620-
621-
<ol>
622-
<li>If the original number is 0, the representation is simply the character
623-
for 0 from the counter style's table, below. End this algorithm.</li>
624-
625-
<li>Split the decimal number into groups of four digits, starting with
626-
the least significant digit.</li>
627-
628-
<li>Ignoring groups that have the value 0, append the second group marker
629-
to the second group, the third group marker to the third group, and the
630-
fourth group marker to the fourth group. The first group has no marker.</li>
631-
632-
<li>For each group, ignoring digits that have the value 0, append the
633-
second digit marker to the second digit, the third digit marker to the
634-
third digit, and the fourth digit marker to the fourth digit. The first
635-
digit has no marker.</li>
636-
637-
<li>If the second, third, or fourth digit of any group was a 1, remove
638-
the 1 (leave the digit marker). If any digit was a 0, remove it.</li>
639-
640-
<li>Concatenate the groups back into a single string, least significant
641-
group first (on the right).</li>
642-
643-
<li>Replace each digit with the relevant character from the counter style's
644-
table, below.</li>
645-
</ol>
646655

647-
<p>The following tables define the characters used in the two Japanese counter
648-
styles:</p>
649-
650-
<dl>
651656
<dt><dfn>japanese-informal</dfn></dt>
652657
<dd>
653658
<table>
@@ -659,7 +664,7 @@ <h4 id='japanese-counter-styles'>
659664
<tbody>
660665
<tr>
661666
<td>Digit 0
662-
<td> U+96F6
667+
<td> U+3007
663668
<tr>
664669
<td>Digit 1
665670
<td>一 U+4E00
@@ -705,11 +710,14 @@ <h4 id='japanese-counter-styles'>
705710
<tr>
706711
<td>Fourth Group Marker
707712
<td>兆 U+5146
713+
<tr>
714+
<td>Negative Sign
715+
<td>マイナス U+30DE U+30A4 U+30CA U+30B9
708716
</tbody>
709717
</table>
710718
</dd>
711719

712-
<dt><dfn>japanese-financial</dfn></dt>
720+
<dt><dfn>japanese-formal</dfn></dt>
713721
<dd>
714722
<table>
715723
<thead>
@@ -766,55 +774,14 @@ <h4 id='japanese-counter-styles'>
766774
<tr>
767775
<td>Fourth Group Marker
768776
<td>兆 U+5146
777+
<tr>
778+
<td>Negative Sign
779+
<td>マイナス U+30DE U+30A4 U+30CA U+30B9
769780
</tbody>
770781
</table>
771782
</dd>
772-
</dl>
773-
774-
775-
<h4 id='korean-counter-styles'>
776-
The Korean "spoken-out" counter styles</h4>
777-
778-
<p>The Korean "spoken-out" counter styles are similar to the
779-
<i title="chinese-counter-styles">Chinese "spoken-out" counter styles</i>,
780-
except that they use different characters, use a slightly different algorithm,
781-
and are not defined for negative numbers. The following algorithm converts
782-
decimal digits into Korean numbers:</p>
783-
784-
<ol>
785-
<li>If the original number is 0, the representation is simply the character
786-
for 0 from the counter style's table, below. End this algorithm.</li>
787-
788-
<li>Split the decimal number into groups of four digits, starting with
789-
the least significant digit.</li>
790-
791-
<li>Ignoring groups that have the value 0, append the second group marker
792-
to the second group, the third group marker to the third group, and the
793-
fourth group marker to the fourth group. The first group has no marker.</li>
794-
795-
<li>For each group, ignoring digits that have the value 0, append the
796-
second digit marker to the second digit, the third digit marker to the
797-
third digit, and the fourth digit marker to the fourth digit. The first
798-
digit has no marker.</li>
799783

800-
<li>If the second, third, or fourth digit of any group is a 1, remove
801-
the 1 (leave the digit marker). If the first digit of the second group
802-
is a 1 and all other digits of the second group are 0, remove the 1
803-
(leave the group marker). If any digit was a 0, remove it.</li>
804-
805-
<li>Concatenate the groups back into a single string, least significant
806-
group first (on the right), with a space (" " U+0020) inserted between
807-
each group.</li>
808-
809-
<li>Replace each digit with the relevant character from the counter style's
810-
table, below.</li>
811-
</ol>
812-
813-
<p>The following tables define the characters used in the Korean counter
814-
styles:</p>
815-
816-
<dl>
817-
<dt><dfn>korean-hangul-financial</dfn></dt>
784+
<dt><dfn>korean-hangul-formal</dfn></dt>
818785
<dd>
819786
<table>
820787
<thead>
@@ -936,7 +903,7 @@ <h4 id='korean-counter-styles'>
936903
</table>
937904
</dd>
938905

939-
<dt><dfn>korean-hanja-financial</dfn></dt>
906+
<dt><dfn>korean-hanja-formal</dfn></dt>
940907
<dd>
941908
<table>
942909
<thead>
@@ -998,6 +965,13 @@ <h4 id='korean-counter-styles'>
998965
</dd>
999966
</dl>
1000967

968+
<p class=note>Note: Chinese, Japanese, and Korean spoken-out numbering (what
969+
this section defines) is actually defined up to 10<sup>72</sup>. Numbers
970+
higher than 10<sup>16</sup> are usually written in scientific notation,
971+
however, and there is some variation in the group markers used for such numbers,
972+
so the algorithm has been intentionally defined only to 10<sup>16</sup>.</p>
973+
974+
1001975
<!-- ====================================================================== -->
1002976

1003977
<h2 id='list-style-image-property'>

0 commit comments

Comments
 (0)