ICU-4930 Fix number spellout for Italian

X-SVN-Rev: 22329
This commit is contained in:
John Emmons 2007-08-09 20:29:32 +00:00
parent 059d96e0e8
commit 3250ab24d7
2 changed files with 88 additions and 24 deletions

View file

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2004, International Business Machines
// * Copyright (C) 2004, 2007 International Business Machines
// * Corporation and others. All Rights Reserved.
// *
// ***************************************************************************
@ -18,11 +18,12 @@ it {
// * end of the first word: 180 is "centottanta," not "centoottanta."
// * The complexity of this rule set is to produce this behavior.
// Can someone confirm that I did the vowel-eliding thing right? I'm
// not 100% sure I'm doing it in all the right places, or completely
// correctly. Also, I don't have information for negatives and decimals,
// and I lack words fror values from 1,000,000 on up.
// * The "no-final" stanzas are used to deal with the fact that the number
// * three ( "tre" ) takes an accent when it is at the end of a word
// * like 23 ( ventitr<e-accent> ), but would NOT take an accent
// * in the context of a thousands or millions, for example,
// * 23,000 would be ventitremila, and would not have an accent on the "tre".
//
SpelloutRules {
// main rule set. Follows the patterns of the preceding rule sets,
// except that the final vowel is omitted from words ending in
@ -39,7 +40,7 @@ it {
"dieci; undici; dodici; tredici; quattordici; quindici; sedici;\n"
" diciasette; diciotto; diciannove;\n"
"20: venti; vent>%%with-i>;\n"
"30: trenta; trent>%%with-i>;\n"
"30: trenta; trent>%%with-a>;\n"
"40: quaranta; quarant>%%with-a>;\n"
"50: cinquanta; cinquant>%%with-a>;\n"
"60: sessanta; sessant>%%with-a>;\n"
@ -48,16 +49,35 @@ it {
"90: novanta; novant>%%with-a>;\n"
"100: cento; cent[>%%with-o>];\n"
"200: <<cento; <<cent[>%%with-o>];\n"
"1000: mille; mill[>%%with-i>];\n"
"2000: <<mila; <<mil[>%%with-a>];\n"
"100,000>>: <<mila[ >>];\n"
"1,000,000: =#,##0= (incomplete data);\n"
"1000: mille; mille>>;\n"
"2000: <%%no-final<mila; <%%no-final<mil>%%with-a>;\n"
"100,000>>: <%%no-final<mila[ >>];\n"
"1,000,000: un milione; un milione >>;\n"
"2,000,000: << milioni[ >>];\n"
"1,000,000,000: un miliardo; un miliardo >>;\n"
"2,000,000,000: << miliardi[ >>];\n"
"1,000,000,000,000: =#,##0= (incomplete data);\n"
"%%no-final:\n"
"zero; uno; due; tre; quattro; cinque; sei; sette; otto; nove;\n"
"dieci; undici; dodici; tredici; quattordici; quindici; sedici;\n"
" diciasette; diciotto; diciannove;\n"
"20: venti; vent>%%with-i-nofinal>;\n"
"30: trenta; trent>%%with-a-nofinal>;\n"
"40: quaranta; quarant>%%with-a-nofinal>;\n"
"50: cinquanta; cinquant>%%with-a-nofinal>;\n"
"60: sessanta; sessant>%%with-a-nofinal>;\n"
"70: settanta; settant>%%with-a-nofinal>;\n"
"80: ottanta; ottant>%%with-a-nofinal>;\n"
"90: novanta; novant>%%with-a-nofinal>;\n"
"100: cento; cent[>%%with-o-nofinal>];\n"
"200: <<cento; <<cent[>%%with-o-nofinal>];\n"
"1,000: =%main=;\n"
"%%with-a:\n"
"azero; uno; adue; atre; aquattro; acinque; asei; asette; otto; anove;\n"
"azero; uno; adue; atr\u00E9; aquattro; acinque; asei; asette; otto; anove;\n"
"adieci; undici; adodici; atredici; aquattordici; aquindici; asedici;\n"
" adiciasette; adiciotto; adiciannove;\n"
"20: aventi; avent>%%with-i>;\n"
"30: atrenta; atrent>%%with-i>;\n"
"30: atrenta; atrent>%%with-a>;\n"
"40: aquaranta; aquarant>%%with-a>;\n"
"50: acinquanta; acinquant>%%with-a>;\n"
"60: asessanta; asessant>%%with-a>;\n"
@ -69,12 +89,27 @@ it {
"1000: amille; amill[>%%with-i>];\n"
"2000: <%%with-a<mila; <%%with-a<mil[>%%with-a>];\n"
"100,000: =%main=;\n"
"%%with-a-nofinal:\n"
"azero; uno; adue; atre; aquattro; acinque; asei; asette; otto; anove;\n"
"adieci; undici; adodici; atredici; aquattordici; aquindici; asedici;\n"
" adiciasette; adiciotto; adiciannove;\n"
"20: aventi; avent>%%with-i-nofinal>;\n"
"30: atrenta; atrent>%%with-a-nofinal>;\n"
"40: aquaranta; aquarant>%%with-a-nofinal>;\n"
"50: acinquanta; acinquant>%%with-a-nofinal>;\n"
"60: asessanta; asessant>%%with-a-nofinal>;\n"
"70: asettanta; asettant>%%with-a-nofinal>;\n"
"80: ottanta; ottant>%%with-a-nofinal>;\n"
"90: anovanta; anovant>%%with-a-nofinal>;\n"
"100: acento; acent[>%%with-o-nofinal>];\n"
"200: <%%with-a-nofinal<cento; <%%with-a-nofinal<cent[>%%with-o-nofinal>];\n"
"1,000: =%main=;\n"
"%%with-i:\n"
"izero; uno; idue; itre; iquattro; icinque; isei; isette; otto; inove;\n"
"izero; uno; idue; itr\u00E9; iquattro; icinque; isei; isette; otto; inove;\n"
"idieci; undici; idodici; itredici; iquattordici; iquindici; isedici;\n"
" idiciasette; idiciotto; idiciannove;\n"
"20: iventi; ivent>%%with-i>;\n"
"30: itrenta; itrent>%%with-i>;\n"
"30: itrenta; itrent>%%with-a>;\n"
"40: iquaranta; iquarant>%%with-a>;\n"
"50: icinquanta; icinquant>%%with-a>;\n"
"60: isessanta; isessant>%%with-a>;\n"
@ -86,12 +121,27 @@ it {
"1000: imille; imill[>%%with-i>];\n"
"2000: <%%with-i<mila; <%%with-i<mil[>%%with-a>];\n"
"100,000: =%main=;\n"
"%%with-i-nofinal:\n"
"izero; uno; idue; itre; iquattro; icinque; isei; isette; otto; inove;\n"
"idieci; undici; idodici; itredici; iquattordici; iquindici; isedici;\n"
" idiciasette; idiciotto; idiciannove;\n"
"20: iventi; ivent>%%with-i-nofinal>;\n"
"30: itrenta; itrent>%%with-a-nofinal>;\n"
"40: iquaranta; iquarant>%%with-a-nofinal>;\n"
"50: icinquanta; icinquant>%%with-a-nofinal>;\n"
"60: isessanta; isessant>%%with-a-nofinal>;\n"
"70: isettanta; isettant>%%with-a-nofinal>;\n"
"80: ottanta; ottant>%%with-a-nofinal>;\n"
"90: inovanta; inovant>%%with-a-nofinal>;\n"
"100: icento; icent[>%%with-o-nofinal>];\n"
"200: <%%with-i-nofinal<cento; <%%with-i-nofinal<cent[>%%with-o-nofinal>];\n"
"1,000: =%main=;\n"
"%%with-o:\n"
"ozero; uno; odue; otre; oquattro; ocinque; osei; osette; otto; onove;\n"
"ozero; uno; odue; otr\u00E9; oquattro; ocinque; osei; osette; otto; onove;\n"
"odieci; undici; ododici; otredici; oquattordici; oquindici; osedici;\n"
" odiciasette; odiciotto; odiciannove;\n"
"20: oventi; ovent>%%with-i>;\n"
"30: otrenta; otrent>%%with-i>;\n"
"30: otrenta; otrent>%%with-a>;\n"
"40: oquaranta; oquarant>%%with-a>;\n"
"50: ocinquanta; ocinquant>%%with-a>;\n"
"60: osessanta; osessant>%%with-a>;\n"
@ -103,6 +153,20 @@ it {
"1000: omille; omill[>%%with-i>];\n"
"2000: <%%with-o<mila; <%%with-o<mil[>%%with-a>];\n"
"100,000: =%main=;\n"
"%%with-o-nofinal:\n"
"ozero; uno; odue; otre; oquattro; ocinque; osei; osette; otto; onove;\n"
"odieci; undici; ododici; otredici; oquattordici; oquindici; osedici;\n"
" odiciasette; odiciotto; odiciannove;\n"
"20: oventi; ovent>%%with-i-nofinal>;\n"
"30: otrenta; otrent>%%with-a-nofinal>;\n"
"40: oquaranta; oquarant>%%with-a-nofinal>;\n"
"50: ocinquanta; ocinquant>%%with-a-nofinal>;\n"
"60: osessanta; osessant>%%with-a-nofinal>;\n"
"70: osettanta; osettant>%%with-a-nofinal>;\n"
"80: ottanta; ottant>%%with-a-nofinal>;\n"
"90: onovanta; onovant>%%with-a-nofinal>;\n"
"100: ocento; ocent[>%%with-o-nofinal>];\n"
"200: <%%with-o-nofinal<cento; <%%with-o-nofinal<cent[>%%with-o-nofinal>];\n"
"1,000: =%main=;\n"
}
}

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2006, International Business Machines Corporation and *
* Copyright (C) 1996-2007, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -1335,8 +1335,8 @@ IntlTestRBNF::TestItalianSpellout()
{ "1", "uno" },
{ "15", "quindici" },
{ "20", "venti" },
{ "23", "ventitre" },
{ "73", "settantatre" },
{ "23", "ventitr\\u00E9" },
{ "73", "settantatr\\u00E9" },
{ "88", "ottantotto" },
{ "100", "cento" },
{ "106", "centosei" },
@ -1349,9 +1349,9 @@ IntlTestRBNF::TestItalianSpellout()
{ "2,000", "duemila" },
{ "3,004", "tremilaquattro" },
{ "4,567", "quattromilacinquecentosessantasette" },
{ "15,943", "quindicimilanovecentoquarantatre" },
{ "-36", "meno trentisei" },
{ "234.567", "duecentotrentiquattro virgola cinque sei sette" },
{ "15,943", "quindicimilanovecentoquarantatr\\u00E9" },
{ "-36", "meno trentasei" },
{ "234.567", "duecentotrentaquattro virgola cinque sei sette" },
{ NULL, NULL}
};