diff --git a/internal/plural/codegen/plurals.xml b/internal/plural/codegen/plurals.xml index ab8e0e8e..9b1100a2 100644 --- a/internal/plural/codegen/plurals.xml +++ b/internal/plural/codegen/plurals.xml @@ -1,9 +1,9 @@ @@ -27,7 +27,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic i = 0,1 @integer 0, 1 @decimal 0.0~1.5 @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, … - + i = 1 and v = 0 @integer 1 @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, … @@ -35,7 +35,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic n = 0,1 or i = 0 and f = 1 @integer 0, 1 @decimal 0.0, 0.1, 1.0, 0.00, 0.01, 1.00, 0.000, 0.001, 1.000, 0.0000, 0.0001, 1.0000 @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.2~0.9, 1.1~1.8, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, … - + n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000 @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, … @@ -76,15 +76,15 @@ CLDR data files are interpreted according to the LDML specification (http://unic i = 0,1 and n != 0 @integer 1 @decimal 0.1~1.6 @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, … - + n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000 n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000 @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, … - + n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000 n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000 - @integer 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~2.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, … + @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, … @@ -130,7 +130,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic e = 0 and i != 0 and i % 1000000 = 0 and v = 0 or e != 0..5 @integer 1000000, 1c6, 2c6, 3c6, 4c6, 5c6, 6c6, … @decimal 1.0000001c6, 1.1c6, 2.0000001c6, 2.1c6, 3.0000001c6, 3.1c6, … @integer 2~17, 100, 1000, 10000, 100000, 1c3, 2c3, 3c3, 4c3, 5c3, 6c3, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 1.0001c3, 1.1c3, 2.0001c3, 2.1c3, 3.0001c3, 3.1c3, … - + i = 1 and v = 0 @integer 1 e = 0 and i != 0 and i % 1000000 = 0 and v = 0 or e != 0..5 @integer 1000000, 1c6, 2c6, 3c6, 4c6, 5c6, 6c6, … @decimal 1.0000001c6, 1.1c6, 2.0000001c6, 2.1c6, 3.0000001c6, 3.1c6, … @integer 0, 2~16, 100, 1000, 10000, 100000, 1c3, 2c3, 3c3, 4c3, 5c3, 6c3, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 1.0001c3, 1.1c3, 2.0001c3, 2.1c3, 3.0001c3, 3.1c3, … diff --git a/internal/plural/rule_gen.go b/internal/plural/rule_gen.go index 258311ca..a19c8916 100644 --- a/internal/plural/rule_gen.go +++ b/internal/plural/rule_gen.go @@ -33,7 +33,7 @@ func DefaultRules() Rules { return Other }, }) - addPluralRules(rules, []string{"ast", "de", "en", "et", "fi", "fy", "gl", "ia", "io", "ji", "lij", "nl", "sc", "scn", "sv", "sw", "ur", "yi"}, &Rule{ + addPluralRules(rules, []string{"ast", "de", "en", "et", "fi", "fy", "gl", "ia", "io", "ji", "lij", "nl", "sc", "sv", "sw", "ur", "yi"}, &Rule{ PluralForms: newPluralFormSet(One, Other), PluralFormFunc: func(ops *Operands) Form { // i = 1 and v = 0 @@ -54,7 +54,7 @@ func DefaultRules() Rules { return Other }, }) - addPluralRules(rules, []string{"ak", "bho", "guw", "ln", "mg", "nso", "pa", "ti", "wa"}, &Rule{ + addPluralRules(rules, []string{"ak", "bho", "csw", "guw", "ln", "mg", "nso", "pa", "ti", "wa"}, &Rule{ PluralForms: newPluralFormSet(One, Other), PluralFormFunc: func(ops *Operands) Form { // n = 0..1 @@ -162,7 +162,7 @@ func DefaultRules() Rules { return Other }, }) - addPluralRules(rules, []string{"ksh"}, &Rule{ + addPluralRules(rules, []string{"blo"}, &Rule{ PluralForms: newPluralFormSet(Zero, One, Other), PluralFormFunc: func(ops *Operands) Form { // n = 0 @@ -176,7 +176,7 @@ func DefaultRules() Rules { return Other }, }) - addPluralRules(rules, []string{"blo"}, &Rule{ + addPluralRules(rules, []string{"ksh"}, &Rule{ PluralForms: newPluralFormSet(Zero, One, Other), PluralFormFunc: func(ops *Operands) Form { // n = 0 @@ -296,7 +296,7 @@ func DefaultRules() Rules { return Other }, }) - addPluralRules(rules, []string{"ca", "it", "pt_PT", "vec"}, &Rule{ + addPluralRules(rules, []string{"ca", "it", "lld", "pt_PT", "scn", "vec"}, &Rule{ PluralForms: newPluralFormSet(One, Many, Other), PluralFormFunc: func(ops *Operands) Form { // i = 1 and v = 0 diff --git a/internal/plural/rule_gen_test.go b/internal/plural/rule_gen_test.go index 03e6c3cd..b949dfb1 100644 --- a/internal/plural/rule_gen_test.go +++ b/internal/plural/rule_gen_test.go @@ -46,7 +46,7 @@ func TestFfHyKab(t *testing.T) { } } -func TestAstDeEnEtFiFyGlIaIoJiLijNlScScnSvSwUrYi(t *testing.T) { +func TestAstDeEnEtFiFyGlIaIoJiLijNlScSvSwUrYi(t *testing.T) { var tests []pluralFormTest tests = appendIntegerTests(tests, One, []string{"1"}) @@ -54,7 +54,7 @@ func TestAstDeEnEtFiFyGlIaIoJiLijNlScScnSvSwUrYi(t *testing.T) { tests = appendIntegerTests(tests, Other, []string{"0", "2~16", "100", "1000", "10000", "100000", "1000000"}) tests = appendDecimalTests(tests, Other, []string{"0.0~1.5", "10.0", "100.0", "1000.0", "10000.0", "100000.0", "1000000.0"}) - locales := []string{"ast", "de", "en", "et", "fi", "fy", "gl", "ia", "io", "ji", "lij", "nl", "sc", "scn", "sv", "sw", "ur", "yi"} + locales := []string{"ast", "de", "en", "et", "fi", "fy", "gl", "ia", "io", "ji", "lij", "nl", "sc", "sv", "sw", "ur", "yi"} for _, locale := range locales { runTests(t, locale, tests) } @@ -75,7 +75,7 @@ func TestSi(t *testing.T) { } } -func TestAkBhoGuwLnMgNsoPaTiWa(t *testing.T) { +func TestAkBhoCswGuwLnMgNsoPaTiWa(t *testing.T) { var tests []pluralFormTest tests = appendIntegerTests(tests, One, []string{"0", "1"}) @@ -84,7 +84,7 @@ func TestAkBhoGuwLnMgNsoPaTiWa(t *testing.T) { tests = appendIntegerTests(tests, Other, []string{"2~17", "100", "1000", "10000", "100000", "1000000"}) tests = appendDecimalTests(tests, Other, []string{"0.1~0.9", "1.1~1.7", "10.0", "100.0", "1000.0", "10000.0", "100000.0", "1000000.0"}) - locales := []string{"ak", "bho", "guw", "ln", "mg", "nso", "pa", "ti", "wa"} + locales := []string{"ak", "bho", "csw", "guw", "ln", "mg", "nso", "pa", "ti", "wa"} for _, locale := range locales { runTests(t, locale, tests) } @@ -216,7 +216,7 @@ func TestLag(t *testing.T) { } } -func TestKsh(t *testing.T) { +func TestBlo(t *testing.T) { var tests []pluralFormTest tests = appendIntegerTests(tests, Zero, []string{"0"}) @@ -228,13 +228,13 @@ func TestKsh(t *testing.T) { tests = appendIntegerTests(tests, Other, []string{"2~17", "100", "1000", "10000", "100000", "1000000"}) tests = appendDecimalTests(tests, Other, []string{"0.1~0.9", "1.1~1.7", "10.0", "100.0", "1000.0", "10000.0", "100000.0", "1000000.0"}) - locales := []string{"ksh"} + locales := []string{"blo"} for _, locale := range locales { runTests(t, locale, tests) } } -func TestBlo(t *testing.T) { +func TestKsh(t *testing.T) { var tests []pluralFormTest tests = appendIntegerTests(tests, Zero, []string{"0"}) @@ -243,10 +243,10 @@ func TestBlo(t *testing.T) { tests = appendIntegerTests(tests, One, []string{"1"}) tests = appendDecimalTests(tests, One, []string{"1.0", "1.00", "1.000", "1.0000"}) - tests = appendIntegerTests(tests, Other, []string{"2~16", "100", "1000", "10000", "100000", "1000000"}) - tests = appendDecimalTests(tests, Other, []string{"2.0~2.5", "10.0", "100.0", "1000.0", "10000.0", "100000.0", "1000000.0"}) + tests = appendIntegerTests(tests, Other, []string{"2~17", "100", "1000", "10000", "100000", "1000000"}) + tests = appendDecimalTests(tests, Other, []string{"0.1~0.9", "1.1~1.7", "10.0", "100.0", "1000.0", "10000.0", "100000.0", "1000000.0"}) - locales := []string{"blo"} + locales := []string{"ksh"} for _, locale := range locales { runTests(t, locale, tests) } @@ -375,7 +375,7 @@ func TestPt(t *testing.T) { } } -func TestCaItPt_ptVec(t *testing.T) { +func TestCaItLldPt_ptScnVec(t *testing.T) { var tests []pluralFormTest tests = appendIntegerTests(tests, One, []string{"1"}) @@ -386,7 +386,7 @@ func TestCaItPt_ptVec(t *testing.T) { tests = appendIntegerTests(tests, Other, []string{"0", "2~16", "100", "1000", "10000", "100000", "1000", "2000", "3000", "4000", "5000", "6000"}) tests = appendDecimalTests(tests, Other, []string{"0.0~1.5", "10.0", "100.0", "1000.0", "10000.0", "100000.0", "1000000.0", "1.0001e3", "1.1e3", "2.0001e3", "2.1e3", "3.0001e3", "3.1e3"}) - locales := []string{"ca", "it", "pt_PT", "vec"} + locales := []string{"ca", "it", "lld", "pt_PT", "scn", "vec"} for _, locale := range locales { runTests(t, locale, tests) }