Ticket #5592 (new defect)

SVN Diffs for #5592

 

Opened 2 years ago

Last modified 2 months ago

Wrong spelling for numbers in Russian

Reported by: execve@... Assigned to: doug
Priority: assess Milestone: UNSCH
Component: formatting Version: 3.6
Keywords: Cc:
Load: Xref:
Java Version: Operating System:
Project (C/J): all Weeks:
Review:

Description

Test code:

RuleBasedNumberFormat rbnf = new RuleBasedNumberFormat(new Locale("ru"), RuleBasedNumberFormat.SPELLOUT);
System.out.println(rbnf.format(12345.0, new StringBuffer(), null));

prints "двеннадцать тысяча три сто сорок пять", expected "двенадцать тысяч триста сорок пять".

Errors:

1. "двеннадцать" -> "двенадцать"

2. "тысяча" should be "тысяч" - genitive case singular of "тысяча". The rule is: for last "1" numeral should be in nominative case singular ("тысяча", "миллион", "миллиард"), for "2"-"4" should be in genitive case singular ("тысячи", "миллиона", "миллиарда"), for "0" and "5"-"19" should be in genitive case plural ("тысяч", "миллионов", "миллиардов"). For "20" again as for "0", "21" as "1", "30" as "0" and so on.

3. "три сто" should be "триста". It isn't count of hundreds - it is a numeral. Same for other hundreds (200-"двести", 400-"четыреста", 500-"пятьсот").

Please note that every spelled number in Russian can be in 6 grammatical cases and 2 grammatical numbers (singular and plural). Thus, the only one spelling ruleset isn't enought.

Also please note that a word or a phrase after numeral should be changed according rules described above: "1 RUR - один рубль", "2 RUR - два рубля", "5 RUR - пять рублей". Thus, formatter should either be able to change this word according Russian grammatical rules (ha-ha) or return some information (grammatical case and grammatical number, or last user number).

Feel free to contact me if you have any questions.

Attachments

Change History

02/12/07 13:57:16 changed by grhoten

  • xref changed.
  • component changed from unknown to formatting.
  • priority changed from blocker to major.
  • keywords deleted.
  • weeks changed.
  • revw changed.

If you would like multiple RBNF rules, please take a closer look at the Hebrew rules. http://source.icu-project.org/repos/icu/icu/trunk/source/data/rbnf/he.txt

If you would like to make it more likely that these errors will be fixed, creating and submitting a patch would help because most of the ICU developers aren't familiar with Russian.

The source file for the Russian rules can be found here: http://source.icu-project.org/repos/icu/icu/trunk/source/data/rbnf/ru.txt

04/07/07 23:53:26 changed by grhoten

  • load changed.
  • os deleted.
  • java deleted.
  • owner changed from somebody to doug.
  • project changed from ICU4J to all.

07/10/08 10:41:42 changed by yoshito

  • priority changed from major to assess.

09/27/08 09:06:17 changed by kent.karlsson14@...

Note that ticket 6493 (New/updated RBNF data files for several languages) has a ready-made RBNF file for Russian.

However, in ru.2.txt I missed fixing двеннадцать to двенадцать.


Add/Change #5592 (Wrong spelling for numbers in Russian)




Anti spam check: