diff --git a/src/inflection/message2/MF2Factory.hpp b/src/inflection/message2/MF2Factory.hpp index 05ac4a0ae..a622d0de1 100644 --- a/src/inflection/message2/MF2Factory.hpp +++ b/src/inflection/message2/MF2Factory.hpp @@ -21,9 +21,9 @@ *
*
* auto customRegistry = icu::message2::MFFunctionRegistry::Builder(errorCode)
- * .adoptFormatter(FunctionName("inflect"),
+ * .adoptFormatter(FunctionName("i:inflect"),
* MF2Factory::createInflectFormatterFactory(), errorCode)
- * .adoptSelector(FunctionName("inflect"),
+ * .adoptSelector(FunctionName("i:inflect"),
* MF2Factory::createInflectSelectorFactory(), errorCode)
* .build();
*
@@ -31,7 +31,7 @@
* auto mf1 = icu::message2::MessageFormatter::Builder(errorCode)
* .setFunctionRegistry(customRegistry)
* .setLocale(Locale::forLanguageTag("es-MX", errorCode))
- * .setPattern("Location is {$name :inflect hello=world \
+ * .setPattern("Location is {$name :i:inflect hello=world \
* definiteness=definite number=plural \
* gender=feminine}",
* pe, errorCode)
@@ -40,9 +40,9 @@
* auto mf2 = icu::message2::MessageFormatter::Builder(errorCode)
* .setFunctionRegistry(customRegistry)
* .setLocale(Locale::forLanguageTag("es-MX", errorCode))
- * .setPattern(".local $gender = {$name :inflect \
+ * .setPattern(".local $gender = {$name :i:inflect \
* feature=gender} \
- * .local $number = {$name :inflect \
+ * .local $number = {$name :i:inflect \
* feature=number} \
* .match $gender $number \
* feminine singular {{Feminine Singular {$name}}}\
@@ -83,22 +83,22 @@ class INFLECTION_CLASS_API inflection::message2::MF2Factory {
/**
* Create an implementation of icu::message2::FormatterFactory* for the
- * :numeral function (number formatting), based on the inflection library,
+ * :i:numeral function (number formatting), based on the inflection library,
* which can be passed to
* icu::messsage2::MFFunctionRegistry::Builder::adoptFormatter
* to register a custom formatter factory.
*/
static icu::message2::FormatterFactory* createNumeralFormatterFactory(OutputMode mode = OutputMode::PLAIN);
- /** Create a FormatterFactory for the :quantify function (count + unit agreement). */
+ /** Create a FormatterFactory for the :i:quantify function (count + unit agreement). */
static icu::message2::FormatterFactory* createQuantifyFormatterFactory(OutputMode mode = OutputMode::PLAIN);
- /** Create a FormatterFactory for the :list function (array → plain/and/or list). */
+ /** Create a FormatterFactory for the :i:list function (array → plain/and/or list). */
static icu::message2::FormatterFactory* createListFormatterFactory(OutputMode mode = OutputMode::PLAIN);
- /** Create a FormatterFactory for the :pronoun function. */
+ /** Create a FormatterFactory for the :i:pronoun function. */
static icu::message2::FormatterFactory* createPronounFormatterFactory(OutputMode mode = OutputMode::PLAIN);
- /** Create a SelectorFactory for the :pronoun function. */
+ /** Create a SelectorFactory for the :i:pronoun function. */
static icu::message2::SelectorFactory* createPronounSelectorFactory();
};
diff --git a/test/resources/inflection/message2/de_DE.xml b/test/resources/inflection/message2/de_DE.xml
index 3045e16f3..64c96ccdc 100644
--- a/test/resources/inflection/message2/de_DE.xml
+++ b/test/resources/inflection/message2/de_DE.xml
@@ -8,7 +8,7 @@
Bank
- .local $defArticleInPreposition = {$name :inflect number=singular case=accusative to=defArticleInPreposition} .match $defArticleInPreposition
+ .local $defArticleInPreposition = {$name :i:inflect number=singular case=accusative to=defArticleInPreposition} .match $defArticleInPreposition
|in die| {{The defArticleInPreposition of '{$name}' is 'in die'.}}
* {{The defArticleInPreposition of '{$name}' is unexpectedly '$defArticleInPreposition'.}}
@@ -18,7 +18,7 @@
Fundort
- .local $withDefArticleInPreposition = {$name :inflect number=singular case=dative to=withDefArticleInPreposition} .match $withDefArticleInPreposition
+ .local $withDefArticleInPreposition = {$name :i:inflect number=singular case=dative to=withDefArticleInPreposition} .match $withDefArticleInPreposition
|im Fundort| {{The withDefArticleInPreposition of '{$name}' is 'im Fundort'.}}
* {{The withDefArticleInPreposition of '{$name}' is something else.}}
@@ -28,7 +28,7 @@
Bank
- The defArticleInPreposition is {$name :inflect number=singular case=accusative to=defArticleInPreposition}.
+ The defArticleInPreposition is {$name :i:inflect number=singular case=accusative to=defArticleInPreposition}.
The defArticleInPreposition is in die.
diff --git a/test/resources/inflection/message2/en_US.xml b/test/resources/inflection/message2/en_US.xml
index 1516db6e6..e403b0900 100644
--- a/test/resources/inflection/message2/en_US.xml
+++ b/test/resources/inflection/message2/en_US.xml
@@ -8,21 +8,21 @@
lights
- The {$object} {is :inflect number=$object} on.
+ The {$object} {is :i:inflect number=$object} on.
The lights are on.
lights
- {$object :inflect definiteness=definite} {is :inflect number=$object} on.
+ {$object :i:inflect definiteness=definite} {is :i:inflect number=$object} on.
the lights are on.
light
- .local $num = {$object :inflect to=number} .match $num
+ .local $num = {$object :i:inflect to=number} .match $num
plural {{The {$object} are on}}
* {{The {$object} is on}}
@@ -32,7 +32,7 @@ plural {{The {$object} are on}}
lights
- .local $num = {$object :inflect to=number} .match $num
+ .local $num = {$object :i:inflect to=number} .match $num
plural {{The {$object} are on}}
* {{The {$object} is on}}
@@ -42,7 +42,7 @@ plural {{The {$object} are on}}
lights on the front porch
- .local $num = {$object :inflect to=number} .match $num
+ .local $num = {$object :i:inflect to=number} .match $num
plural {{The {$object} are on}}
* {{The {$object} is on}}
@@ -52,7 +52,7 @@ plural {{The {$object} are on}}
light on the front porch
- .local $num = {$object :inflect to=number} .match $num
+ .local $num = {$object :i:inflect to=number} .match $num
plural {{The {$object} are on}}
* {{The {$object} is on}}
@@ -62,28 +62,28 @@ plural {{The {$object} are on}}
brother
- I didn't find {$relationship :inflect definiteness=indefinite} in your contacts. What is your {$relationship :inflect case=genitive} name?
+ I didn't find {$relationship :i:inflect definiteness=indefinite} in your contacts. What is your {$relationship :i:inflect case=genitive} name?
I didn't find a brother in your contacts. What is your brother’s name?
aunt
- I didn't find {$relationship :inflect definiteness=indefinite} in your contacts. What is your {$relationship :inflect case=genitive} name?
+ I didn't find {$relationship :i:inflect definiteness=indefinite} in your contacts. What is your {$relationship :i:inflect case=genitive} name?
I didn't find an aunt in your contacts. What is your aunt’s name?
4
- Your {$oridinalNum :numeral withStyle=asWords withVariant=ordinal} meeting has been canceled
+ Your {$oridinalNum :i:numeral withStyle=asWords withVariant=ordinal} meeting has been canceled
Your fourth meeting has been canceled
4
- You have {$count :numeral withStyle=asSpokenWords} messages
+ You have {$count :i:numeral withStyle=asSpokenWords} messages
You have 4 messages
You have four messages
@@ -92,7 +92,7 @@ plural {{The {$object} are on}}
1
day
- Your meeting is in {$unit :quantify withValue=$n} from now
+ Your meeting is in {$unit :i:quantify withValue=$n} from now
Your meeting is in 1 day from now
@@ -100,7 +100,7 @@ plural {{The {$object} are on}}
2
day
- Your meeting is in {$unit :quantify withValue=$n} from now
+ Your meeting is in {$unit :i:quantify withValue=$n} from now
Your meeting is in 2 days from now
@@ -108,21 +108,21 @@ plural {{The {$object} are on}}
3
church
- {$unit :quantify withValue=$n} were found nearby
+ {$unit :i:quantify withValue=$n} were found nearby
3 churches were found nearby
valid
- {$word :inflect bogusFeature=value}
+ {$word :i:inflect bogusFeature=value}
valid
- .local $v = {$word :inflect bogusFeature=value} .match $v
+ .local $v = {$word :i:inflect bogusFeature=value} .match $v
* {{fallback}}
@@ -131,14 +131,14 @@ plural {{The {$object} are on}}
valid
- {$word :inflect to=bogus}
+ {$word :i:inflect to=bogus}
valid
valid
- .local $v = {$word :inflect to=bogus} .match $v
+ .local $v = {$word :i:inflect to=bogus} .match $v
valid {{is valid}}
* {{other}}
@@ -146,22 +146,22 @@ valid {{is valid}}
her
- {$p :pronoun gender=masculine}
+ {$p :i:pronoun gender=masculine}
his
theirs
- {$p :pronoun gender=masculine}
+ {$p :i:pronoun gender=masculine}
his
he
- {theirs :pronoun gender=$p}
+ {theirs :i:pronoun gender=$p}
his
she
- .local $g = {$p :pronoun to=gender} .match $g
+ .local $g = {$p :i:pronoun to=gender} .match $g
feminine {{feminine phrase}}
masculine {{masculine phrase}}
* {{other phrase}}
@@ -170,7 +170,7 @@ masculine {{masculine phrase}}
garbage
- {$p :pronoun}
+ {$p :i:pronoun}
@@ -178,7 +178,7 @@ masculine {{masculine phrase}}
her
cat
- {$p :pronoun to=gender withReferent=$obj}
+ {$p :i:pronoun to=gender withReferent=$obj}
@@ -189,7 +189,7 @@ masculine {{masculine phrase}}
xyr
- {$np :pronoun case=accusative} {$np :pronoun}
+ {$np :i:pronoun case=accusative} {$np :i:pronoun}
xem xe
diff --git a/test/resources/inflection/message2/es_MX.xml b/test/resources/inflection/message2/es_MX.xml
index eb0081ce6..f94a33115 100644
--- a/test/resources/inflection/message2/es_MX.xml
+++ b/test/resources/inflection/message2/es_MX.xml
@@ -8,14 +8,14 @@
gato
- Foo {$name :inflect definiteness=definite number=plural gender=feminine} Bar
+ Foo {$name :i:inflect definiteness=definite number=plural gender=feminine} Bar
Foo las gatas Bar
gato
- .local $var1 = {$name :inflect to=gender} .local $var2 = {$name :inflect to=number} .match $var1 $var2
+ .local $var1 = {$name :i:inflect to=gender} .local $var2 = {$name :i:inflect to=number} .match $var1 $var2
masculine 2 {{{$name} is Masculine & 2}}
feminine singular {{{$name} is Feminine & Singular}}
foo 4 {{{$name} is Foo & 4}}
@@ -30,7 +30,7 @@ hello singular {{{$name} is Hello & Singular}}
1
niño
- Hay {$unit :quantify withValue=$n} en el video
+ Hay {$unit :i:quantify withValue=$n} en el video
Hay 1 niño en el video
Hay un niño en el video
@@ -39,7 +39,7 @@ hello singular {{{$name} is Hello & Singular}}
1
niña
- Hay {$unit :quantify withValue=$n} en el video
+ Hay {$unit :i:quantify withValue=$n} en el video
Hay 1 niña en el video
Hay una niña en el video
@@ -48,7 +48,7 @@ hello singular {{{$name} is Hello & Singular}}
3
niño
- Hay {$unit :quantify withValue=$n} en el video
+ Hay {$unit :i:quantify withValue=$n} en el video
Hay 3 niños en el video
Hay tres niños en el video
@@ -56,56 +56,56 @@ hello singular {{{$name} is Hello & Singular}}
gato gata gatos gatas
- ¿Te gustan los videos sobre {$words :list withType=and definiteness=definite}?
+ ¿Te gustan los videos sobre {$words :i:list withType=and definiteness=definite}?
¿Te gustan los videos sobre el gato, la gata, los gatos y las gatas?
gatos
- ¿Te gustan los videos sobre {$words :list withType=and definiteness=definite}?
+ ¿Te gustan los videos sobre {$words :i:list withType=and definiteness=definite}?
¿Te gustan los videos sobre los gatos?
gatos idiomas
- ¿Te gustan los videos sobre {$words :list withType=and}?
+ ¿Te gustan los videos sobre {$words :i:list withType=and}?
¿Te gustan los videos sobre gatos e idiomas?
idiomas gatos
- ¿Te gustan los videos sobre {$words :list withType=and}?
+ ¿Te gustan los videos sobre {$words :i:list withType=and}?
¿Te gustan los videos sobre idiomas y gatos?
gatos idiomas
- ¿Te gustan los videos sobre {$words :list withType=or}?
+ ¿Te gustan los videos sobre {$words :i:list withType=or}?
¿Te gustan los videos sobre gatos o idiomas?
gatos idiomas
- {$words :list}
+ {$words :i:list}
gatosidiomas
gato gata gatos
- {$words :list withItemDelimiter=|, | withBeforeLast=| y | withItemPrefix=|[| withItemSuffix=|]|}
+ {$words :i:list withItemDelimiter=|, | withBeforeLast=| y | withItemPrefix=|[| withItemSuffix=|]|}
[gato], [gata] y [gatos]
gato gata
- {$words :list withType=and withAvoidItemAffixRedundancy=false}
+ {$words :i:list withType=and withAvoidItemAffixRedundancy=false}
gato y gata
@@ -113,7 +113,7 @@ hello singular {{{$name} is Hello & Singular}}
mío
casas
- {$p :pronoun withReferent=$obj}
+ {$p :i:pronoun withReferent=$obj}
mías
diff --git a/test/resources/inflection/message2/ru_RU.xml b/test/resources/inflection/message2/ru_RU.xml
index d8053abd2..eca573164 100644
--- a/test/resources/inflection/message2/ru_RU.xml
+++ b/test/resources/inflection/message2/ru_RU.xml
@@ -9,7 +9,7 @@
1
километр
- {$unit :quantify withValue=$n} {$unit :quantify withValue=$n case=genitive} {$unit :quantify withValue=$n case=accusative} {$unit :quantify withValue=$n case=dative} {$unit :quantify withValue=$n case=instrumental} {$unit :quantify withValue=$n case=prepositional}
+ {$unit :i:quantify withValue=$n} {$unit :i:quantify withValue=$n case=genitive} {$unit :i:quantify withValue=$n case=accusative} {$unit :i:quantify withValue=$n case=dative} {$unit :i:quantify withValue=$n case=instrumental} {$unit :i:quantify withValue=$n case=prepositional}
1 километр 1 километра 1 километр 1 километру 1 километром 1 километре
@@ -17,7 +17,7 @@
2
километр
- {$unit :quantify withValue=$n} {$unit :quantify withValue=$n case=genitive} {$unit :quantify withValue=$n case=accusative} {$unit :quantify withValue=$n case=dative} {$unit :quantify withValue=$n case=instrumental} {$unit :quantify withValue=$n case=prepositional}
+ {$unit :i:quantify withValue=$n} {$unit :i:quantify withValue=$n case=genitive} {$unit :i:quantify withValue=$n case=accusative} {$unit :i:quantify withValue=$n case=dative} {$unit :i:quantify withValue=$n case=instrumental} {$unit :i:quantify withValue=$n case=prepositional}
2 километра 2 километров 2 километра 2 километрам 2 километрами 2 километрах
@@ -25,7 +25,7 @@
5
километр
- {$unit :quantify withValue=$n} {$unit :quantify withValue=$n case=genitive} {$unit :quantify withValue=$n case=accusative} {$unit :quantify withValue=$n case=dative} {$unit :quantify withValue=$n case=instrumental} {$unit :quantify withValue=$n case=prepositional}
+ {$unit :i:quantify withValue=$n} {$unit :i:quantify withValue=$n case=genitive} {$unit :i:quantify withValue=$n case=accusative} {$unit :i:quantify withValue=$n case=dative} {$unit :i:quantify withValue=$n case=instrumental} {$unit :i:quantify withValue=$n case=prepositional}
5 километров 5 километров 5 километров 5 километрам 5 километрами 5 километрах
@@ -45,7 +45,7 @@
prepositional,plural
- {$unit :inflect gender=neuter case=genitive number=singular}
+ {$unit :i:inflect gender=neuter case=genitive number=singular}
genitive,singular
@@ -66,7 +66,7 @@
prepositional,plural
- {$unit :quantify withValue=$number} {$unit :quantify withValue=$number case=genitive} {$unit :quantify withValue=$number case=accusative} {$unit :quantify withValue=$number case=dative} {$unit :quantify withValue=$number case=instrumental} {$unit :quantify withValue=$number case=prepositional}
+ {$unit :i:quantify withValue=$number} {$unit :i:quantify withValue=$number case=genitive} {$unit :i:quantify withValue=$number case=accusative} {$unit :i:quantify withValue=$number case=dative} {$unit :i:quantify withValue=$number case=instrumental} {$unit :i:quantify withValue=$number case=prepositional}
1 nominative,singular 1 genitive,singular 1 accusative,singular 1 dative,singular 1 instrumental,singular 1 prepositional,singular
одно nominative,singular одного genitive,singular одно accusative,singular одному dative,singular одним instrumental,singular одном prepositional,singular
@@ -88,7 +88,7 @@
prepositional,plural
- {$unit :quantify withValue=$number} {$unit :quantify withValue=$number case=genitive} {$unit :quantify withValue=$number case=accusative} {$unit :quantify withValue=$number case=dative} {$unit :quantify withValue=$number case=instrumental} {$unit :quantify withValue=$number case=prepositional}
+ {$unit :i:quantify withValue=$number} {$unit :i:quantify withValue=$number case=genitive} {$unit :i:quantify withValue=$number case=accusative} {$unit :i:quantify withValue=$number case=dative} {$unit :i:quantify withValue=$number case=instrumental} {$unit :i:quantify withValue=$number case=prepositional}
2 genitive,singular 2 genitive,plural 2 genitive,plural 2 dative,plural 2 instrumental,plural 2 prepositional,plural
два genitive,singular двух genitive,plural два genitive,plural двум dative,plural двумя instrumental,plural двух prepositional,plural
@@ -110,7 +110,7 @@
prepositional,plural
- {$unit :quantify withValue=$number} {$unit :quantify withValue=$number case=genitive} {$unit :quantify withValue=$number case=accusative} {$unit :quantify withValue=$number case=dative} {$unit :quantify withValue=$number case=instrumental} {$unit :quantify withValue=$number case=prepositional}
+ {$unit :i:quantify withValue=$number} {$unit :i:quantify withValue=$number case=genitive} {$unit :i:quantify withValue=$number case=accusative} {$unit :i:quantify withValue=$number case=dative} {$unit :i:quantify withValue=$number case=instrumental} {$unit :i:quantify withValue=$number case=prepositional}
5 genitive,plural 5 genitive,plural 5 genitive,plural 5 dative,plural 5 instrumental,plural 5 prepositional,plural
пять genitive,plural пяти genitive,plural пять genitive,plural пяти dative,plural пятью instrumental,plural пяти prepositional,plural
@@ -131,7 +131,7 @@
prepositional,plural
- .local $v = {$unit :inflect gender=neuter case=genitive number=singular} .match $v
+ .local $v = {$unit :i:inflect gender=neuter case=genitive number=singular} .match $v
|genitive,singular| {{matched genitive singular}}
* {{other}}
diff --git a/test/src/inflection/message2/Message2Test.cpp b/test/src/inflection/message2/Message2Test.cpp
index e13ab8388..6b47320e2 100644
--- a/test/src/inflection/message2/Message2Test.cpp
+++ b/test/src/inflection/message2/Message2Test.cpp
@@ -275,13 +275,13 @@ TEST_CASE("Message2Test#testLocales")
auto buildRegistry = [&](inflection::message2::MF2Factory::OutputMode mode) {
UErrorCode ec = U_ZERO_ERROR;
auto r = MFFunctionRegistry::Builder(ec)
- .adoptFormatter(FunctionName("inflect"), inflection::message2::MF2Factory::createInflectFormatterFactory(mode), ec)
- .adoptSelector(FunctionName("inflect"), inflection::message2::MF2Factory::createInflectSelectorFactory(), ec)
- .adoptFormatter(FunctionName("numeral"), inflection::message2::MF2Factory::createNumeralFormatterFactory(mode), ec)
- .adoptFormatter(FunctionName("quantify"), inflection::message2::MF2Factory::createQuantifyFormatterFactory(mode), ec)
- .adoptFormatter(FunctionName("list"), inflection::message2::MF2Factory::createListFormatterFactory(mode), ec)
- .adoptFormatter(FunctionName("pronoun"), inflection::message2::MF2Factory::createPronounFormatterFactory(mode), ec)
- .adoptSelector(FunctionName("pronoun"), inflection::message2::MF2Factory::createPronounSelectorFactory(), ec)
+ .adoptFormatter(FunctionName("i:inflect"), inflection::message2::MF2Factory::createInflectFormatterFactory(mode), ec)
+ .adoptSelector(FunctionName("i:inflect"), inflection::message2::MF2Factory::createInflectSelectorFactory(), ec)
+ .adoptFormatter(FunctionName("i:numeral"), inflection::message2::MF2Factory::createNumeralFormatterFactory(mode), ec)
+ .adoptFormatter(FunctionName("i:quantify"), inflection::message2::MF2Factory::createQuantifyFormatterFactory(mode), ec)
+ .adoptFormatter(FunctionName("i:list"), inflection::message2::MF2Factory::createListFormatterFactory(mode), ec)
+ .adoptFormatter(FunctionName("i:pronoun"), inflection::message2::MF2Factory::createPronounFormatterFactory(mode), ec)
+ .adoptSelector(FunctionName("i:pronoun"), inflection::message2::MF2Factory::createPronounSelectorFactory(), ec)
.build();
REQUIRE(U_SUCCESS(ec));
return r;
@@ -414,7 +414,7 @@ TEST_CASE("Message2Test#testLocales")
.setLocale(icuLocale)
.setPattern(UnicodeString(source.c_str()), pe, testError);
if (errorExpected) {
- // Surface MF errors (e.g. an unknown :inflect feature) via the UErrorCode.
+ // Surface MF errors (e.g. an unknown :i:inflect feature) via the UErrorCode.
builder.setErrorHandlingBehavior(MessageFormatter::U_MF_STRICT);
}
MessageFormatter mf = builder.build(testError);