Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for sr-SR #40

Merged
merged 22 commits into from
Feb 11, 2025
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3bfba9e
How to add a new language doc, adding sr_SR to the list.
nciric Dec 18, 2024
f2f1c36
Integrating patch from George and updating docs.
nciric Dec 19, 2024
2a461e1
Small docs fix.
nciric Dec 19, 2024
b5425dc
Refine how_to_add_new_language.md
grhoten Dec 19, 2024
bd18e42
Update GrammarSynthesizerFactory.cpp
grhoten Dec 19, 2024
529eb3d
Adding pointer to test lexicon in docs.
nciric Dec 19, 2024
65e325d
Merge branch 'cira-sr' of https://github.com/unicode-org/inflection i…
nciric Dec 19, 2024
280c591
Adding test data for Serbian.
nciric Jan 7, 2025
abe8a15
Adding new line to test files.
nciric Jan 7, 2025
3bdd2f3
Merge remote-tracking branch 'origin/main' into cira-sr
nciric Jan 9, 2025
af02e3a
Adding files missed after the inflection rename.
nciric Jan 9, 2025
8d1395a
Merge remote-tracking branch 'origin/main' into cira-sr
nciric Jan 13, 2025
7549d7e
Fix local build after removal of CoreFoundations dep.
nciric Jan 13, 2025
732bc56
Merge remote-tracking branch 'origin/main' into cira-sr
nciric Jan 23, 2025
a98f2e0
Merge remote-tracking branch 'origin/main' into cira-sr
nciric Jan 24, 2025
4e775e4
Generating 150 nouns for Serbian lexicon. (#74)
nciric Jan 28, 2025
4ad5425
Merge remote-tracking branch 'origin/main' into cira-sr
nciric Jan 28, 2025
0ecb5d1
Adding dictionary and xml file and some code.
nciric Feb 10, 2025
6c8e680
Switch count to number
grhoten Feb 10, 2025
5a212ff
Switch count to number
grhoten Feb 10, 2025
4f92d16
Add support for Serbian
grhoten Feb 10, 2025
84fd8a1
Fix pronouns and tests before merge
nciric Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
396 changes: 394 additions & 2 deletions data/sr/exceptions.tsv

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions data/sr/lexicon_data.json

Large diffs are not rendered by default.

274 changes: 231 additions & 43 deletions fst/inflection_sr.py

Large diffs are not rendered by default.

1,039 changes: 1,039 additions & 0 deletions inflection/resources/org/unicode/inflection/dictionary/dictionary_sr.lst

Large diffs are not rendered by default.

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions inflection/resources/org/unicode/inflection/features/grammar.xml
Original file line number Diff line number Diff line change
@@ -2315,6 +2315,51 @@
</category>
</grammar>
</language>
<language id="sr">
<grammar>
<category name="case">
<restrictions>
<restriction name="pos" value="noun"/>
<restriction name="pos" value="proper-noun"/>
</restrictions>
<grammeme name="nominative"/>
<grammeme name="genitive"/>
<grammeme name="dative"/>
<grammeme name="accusative"/>
<grammeme name="vocative"/>
<grammeme name="locative"/>
<grammeme name="instrumental"/>
</category>
<category name="number">
<grammeme name="singular"/>
<grammeme name="plural"/>
</category>
<category name="emphasis">
<restrictions>
<restriction name="pos" value="pronoun"/>
</restrictions>
<grammeme name="stressed"/>
<grammeme name="unstressed"/>
</category>
<category name="gender">
<grammeme name="masculine"/>
<grammeme name="feminine"/>
<grammeme name="neuter"/>
</category>
<category name="person">
<grammeme name="first"/>
<grammeme name="second"/>
<grammeme name="third"/>
</category>
<category name="pronounType">
<restrictions>
<restriction name="pos" value="pronoun"/>
</restrictions>
<grammeme name="personal"/>
<grammeme name="reflexive"/>
</category>
</grammar>
</language>
<language id="sv">
<grammar>
<category name="case">
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
оно,third,singular,nominative,neuter
он,third,singular,nominative,masculine
она,third,singular,nominative,feminine
она,third,plural,nominative,neuter
они,third,plural,nominative,masculine
оне,third,plural,nominative,feminine
ти,second,singular,nominative
ви,second,plural,nominative
ја,first,singular,nominative
ми,first,plural,nominative
њега,third,singular,accusative,neuter,stressed
га,third,singular,accusative,neuter,unstressed
њега,third,singular,accusative,masculine,stressed
га,third,singular,accusative,masculine,unstressed
њу,third,singular,accusative,feminine,stressed
ју,third,singular,accusative,feminine,unstressed
њих,third,plural,accusative,gender,stressed
их,third,plural,accusative,gender,unstressed
тебе,second,singular,accusative,stressed
те,second,singular,accusative,unstressed
вас,second,plural,accusative
мене,first,singular,accusative,stressed
ме,first,singular,accusative,unstressed
нас,first,plural,accusative
њему,third,singular,dative,neuter,stressed
му,third,singular,dative,neuter,unstressed
њему,third,singular,dative,masculine,stressed
му,third,singular,dative,masculine,unstressed
њој,third,singular,dative,feminine,stressed
јој,third,singular,dative,feminine,unstressed
њима,third,plural,dative,gender,stressed
им,third,plural,dative,gender,unstressed
теби,second,singular,dative,stressed
ти,second,singular,dative,unstressed
вама,second,plural,dative,stressed
вам,second,plural,dative,unstressed
мени,first,singular,dative,stressed
ми,first,singular,dative,unstressed
нама,first,plural,dative,stressed
нам,first,plural,dative,unstressed
њему,third,singular,locative,neuter
њему,third,singular,locative,masculine
њој,third,singular,locative,feminine
њима,third,plural,locative,gender
теби,second,singular,locative
вама,second,plural,locative
мени,first,singular,locative
нама,first,plural,locative
њим,third,singular,instrumental,neuter
њим,third,singular,instrumental,masculine
њом,third,singular,instrumental,feminine
њима,third,plural,instrumental,gender
тобом,second,singular,instrumental
вама,second,plural,instrumental
мном,first,singular,instrumental
нама,first,plural,instrumental
њега,third,singular,genitive,neuter,stressed
га,third,singular,genitive,neuter,unstressed
њега,third,singular,genitive,masculine,stressed
га,third,singular,genitive,masculine,unstressed
ње,third,singular,genitive,feminine,stressed
је,third,singular,genitive,feminine,unstressed
њих,third,plural,genitive,gender,stressed
их,third,plural,genitive,gender,unstressed
тебе,second,singular,genitive,stressed
те,second,singular,genitive,unstressed
вас,second,plural,genitive
мене,first,singular,genitive,stressed
ме,first,singular,genitive,unstressed
нас,first,plural,genitive
себе,person,number,gender,accusative,reflexive,stressed
се,person,number,gender,accusative,reflexive,unstressed
себи,person,number,gender,dative,reflexive,stressed
си,person,number,gender,dative,reflexive,unstressed
себе,person,number,gender,locative,reflexive
собом,person,number,gender,instrumental,reflexive
себи,person,number,gender,genitive,reflexive,stressed
се,person,number,gender,genitive,reflexive,unstressed
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
# Copyright 2024-2024 Apple Inc. All rights reserved.
#
# The first in each group is the primary language and is loaded first.
# These are languages that are advertised. Don't list a language if you want it to be a secret.
locale.group.ar=ar_SA
locale.group.da=da_DK
locale.group.de=de_DE,de_AT,de_CH
@@ -20,6 +19,7 @@ locale.group.nb=nb_NO
locale.group.nl=nl_NL,nl_BE
locale.group.pt=pt_BR,pt_PT
locale.group.ru=ru_RU
locale.group.sr=sr_RS
locale.group.sv=sv_SE
locale.group.th=th_TH
locale.group.tr=tr_TR
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Copyright 2024 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#
tokenizer.implementation.class=DefaultTokenizer
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
#include <inflection/dialog/language/NlCommonConceptFactory.hpp>
#include <inflection/dialog/language/PtCommonConceptFactory.hpp>
#include <inflection/dialog/language/RuCommonConceptFactory.hpp>
#include <inflection/dialog/language/SrCommonConceptFactory.hpp>
#include <inflection/dialog/language/SvCommonConceptFactory.hpp>
#include <inflection/dialog/language/ThCommonConceptFactory.hpp>
#include <inflection/dialog/language/TrCommonConceptFactory.hpp>
@@ -81,6 +82,7 @@ static CommonConceptFactory* constructCommonConceptFactory(const ::inflection::u
{"nl", &constructor<language::NlCommonConceptFactory>},
{"pt", &constructor<language::PtCommonConceptFactory>},
{"ru", &constructor<language::RuCommonConceptFactory>},
{"sr", &constructor<language::SrCommonConceptFactory>},
{"sv", &constructor<language::SvCommonConceptFactory>},
{"th", &constructor<language::ThCommonConceptFactory>},
{"tr", &constructor<language::TrCommonConceptFactory>},
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2024 and later: Unicode, Inc. and others.
* License & terms of use: http://www.unicode.org/copyright.html
*/
#include <inflection/dialog/language/SrCommonConceptFactory.hpp>

#include <inflection/dialog/SemanticFeatureConceptBase.hpp>
#include <inflection/grammar/synthesis/GrammemeConstants.hpp>
#include <inflection/npc.hpp>

using inflection::grammar::synthesis::GrammemeConstants;

namespace inflection::dialog::language {

SrCommonConceptFactory::SrCommonConceptFactory(const ::inflection::util::ULocale &language)
: super(language, ::inflection::grammar::synthesis::GrammemeConstants::GENDER, {
{::inflection::grammar::synthesis::GrammemeConstants::GENDER_MASCULINE(), u"cardinal-masculine"},
{::inflection::grammar::synthesis::GrammemeConstants::GENDER_FEMININE(), u"cardinal-feminine"},
{::inflection::grammar::synthesis::GrammemeConstants::GENDER_NEUTER(), u"cardinal-neuter"}})
{
}

SrCommonConceptFactory::~SrCommonConceptFactory()
{
}

} // namespace inflection::dialog::language
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2024 and later: Unicode, Inc. and others.
* License & terms of use: http://www.unicode.org/copyright.html
*/
#pragma once

#include <inflection/dialog/language/fwd.hpp>
#include <inflection/dialog/CommonConceptFactoryImpl.hpp>

class inflection::dialog::language::SrCommonConceptFactory
: public CommonConceptFactoryImpl
{
public:
typedef CommonConceptFactoryImpl super;

private:

public:
explicit SrCommonConceptFactory(const ::inflection::util::ULocale& language);
~SrCommonConceptFactory() override;
};
1 change: 1 addition & 0 deletions inflection/src/inflection/dialog/language/fwd.hpp
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ namespace inflection
class NlCommonConceptFactory;
class PtCommonConceptFactory;
class RuCommonConceptFactory;
class SrCommonConceptFactory;
class SvCommonConceptFactory;
class ThCommonConceptFactory;
class TrCommonConceptFactory;
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
#include <inflection/grammar/synthesis/NlGrammarSynthesizer.hpp>
#include <inflection/grammar/synthesis/PtGrammarSynthesizer.hpp>
#include <inflection/grammar/synthesis/RuGrammarSynthesizer.hpp>
#include <inflection/grammar/synthesis/SrGrammarSynthesizer.hpp>
#include <inflection/grammar/synthesis/SvGrammarSynthesizer.hpp>
#include <inflection/grammar/synthesis/TrGrammarSynthesizer.hpp>
#include <inflection/util/LocaleUtils.hpp>
@@ -44,6 +45,7 @@ static const ::std::map<::inflection::util::ULocale, addSemanticFeatures>& GRAMM
{::inflection::util::LocaleUtils::DUTCH(), &NlGrammarSynthesizer::addSemanticFeatures},
{::inflection::util::LocaleUtils::PORTUGUESE(), &PtGrammarSynthesizer::addSemanticFeatures},
{::inflection::util::LocaleUtils::RUSSIAN(), &RuGrammarSynthesizer::addSemanticFeatures},
{::inflection::util::LocaleUtils::SERBIAN(), &SrGrammarSynthesizer::addSemanticFeatures},
{::inflection::util::LocaleUtils::SWEDISH(), &SvGrammarSynthesizer::addSemanticFeatures},
{::inflection::util::LocaleUtils::TURKISH(), &TrGrammarSynthesizer::addSemanticFeatures},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2024 and later: Unicode, Inc. and others.
* License & terms of use: http://www.unicode.org/copyright.html
*/
#include <inflection/grammar/synthesis/SrGrammarSynthesizer.hpp>

#include <inflection/dialog/DictionaryLookupFunction.hpp>
#include <inflection/dialog/SemanticFeatureModel.hpp>
#include <inflection/grammar/synthesis/GrammemeConstants.hpp>
#include <inflection/grammar/synthesis/SrGrammarSynthesizer_SrDisplayFunction.hpp>
#include <inflection/util/LocaleUtils.hpp>
#include <inflection/npc.hpp>

namespace inflection::grammar::synthesis {

void SrGrammarSynthesizer::addSemanticFeatures(::inflection::dialog::SemanticFeatureModel& featureModel)
{
featureModel.putDefaultFeatureFunctionByName(GrammemeConstants::GENDER, new ::inflection::dialog::DictionaryLookupFunction(::inflection::util::LocaleUtils::SERBIAN(), {GrammemeConstants::GENDER_MASCULINE(), GrammemeConstants::GENDER_FEMININE(), GrammemeConstants::GENDER_NEUTER()}));
featureModel.putDefaultFeatureFunctionByName(GrammemeConstants::NUMBER, new ::inflection::dialog::DictionaryLookupFunction(::inflection::util::LocaleUtils::SERBIAN(), {GrammemeConstants::NUMBER_SINGULAR(), GrammemeConstants::NUMBER_PLURAL()}));

featureModel.setDefaultDisplayFunction(new SrGrammarSynthesizer_SrDisplayFunction(featureModel));
}

} // namespace inflection::grammar::synthesis
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2024 and later: Unicode, Inc. and others.
* License & terms of use: http://www.unicode.org/copyright.html
*/
#pragma once

#include <inflection/dialog/fwd.hpp>
#include <inflection/grammar/synthesis/fwd.hpp>
#include <string>
#include <set>

class inflection::grammar::synthesis::SrGrammarSynthesizer final
{
public:
static void addSemanticFeatures(::inflection::dialog::SemanticFeatureModel& featureModel);

private:
SrGrammarSynthesizer() = delete;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright 2024 and later: Unicode, Inc. and others.
* License & terms of use: http://www.unicode.org/copyright.html
*/
#include <inflection/grammar/synthesis/SrGrammarSynthesizer_SrDisplayFunction.hpp>

#include <inflection/tokenizer/TokenChain.hpp>
#include <inflection/tokenizer/Tokenizer.hpp>
#include <inflection/tokenizer/TokenizerFactory.hpp>
#include <inflection/dialog/SemanticFeature.hpp>
#include <inflection/dialog/SemanticFeatureModel.hpp>
#include <inflection/dialog/SemanticFeatureModel_DisplayData.hpp>
#include <inflection/dialog/DisplayValue.hpp>
#include <inflection/grammar/synthesis/GrammemeConstants.hpp>
#include <inflection/grammar/synthesis/GrammarSynthesizerUtil.hpp>
#include <inflection/lang/StringFilterUtil.hpp>
#include <inflection/util/LocaleUtils.hpp>
#include <inflection/util/UnicodeSetUtils.hpp>
#include <inflection/npc.hpp>
#include <iterator>
#include <memory>

namespace inflection::grammar::synthesis {

SrGrammarSynthesizer_SrDisplayFunction::SrGrammarSynthesizer_SrDisplayFunction(const ::inflection::dialog::SemanticFeatureModel& model)
: super()
, dictionary(*npc(::inflection::dictionary::DictionaryMetaData::createDictionary(::inflection::util::LocaleUtils::SERBIAN())))
, countFeature(model.getFeature(GrammemeConstants::NUMBER))
, genderFeature(model.getFeature(GrammemeConstants::GENDER))
, partOfSpeechFeature(model.getFeature(GrammemeConstants::POS))
, tokenizer(::inflection::tokenizer::TokenizerFactory::createTokenizer(::inflection::util::LocaleUtils::SERBIAN()))
, dictionaryInflector(::inflection::util::LocaleUtils::SERBIAN(),{
{GrammemeConstants::POS_NOUN(), GrammemeConstants::POS_ADJECTIVE(), GrammemeConstants::POS_VERB()},
{GrammemeConstants::PERSON_THIRD(), GrammemeConstants::PERSON_FIRST(), GrammemeConstants::PERSON_SECOND()},
{GrammemeConstants::NUMBER_SINGULAR(), GrammemeConstants::NUMBER_PLURAL()},
{GrammemeConstants::GENDER_MASCULINE(), GrammemeConstants::GENDER_FEMININE(), GrammemeConstants::GENDER_NEUTER()}
}, {}, true)
{
}

SrGrammarSynthesizer_SrDisplayFunction::~SrGrammarSynthesizer_SrDisplayFunction()
{
}

::inflection::dialog::DisplayValue * SrGrammarSynthesizer_SrDisplayFunction::getDisplayValue(const dialog::SemanticFeatureModel_DisplayData &displayData, const ::std::map<::inflection::dialog::SemanticFeature, ::std::u16string> &constraints, bool enableInflectionGuess) const
{
const auto displayValue = GrammarSynthesizerUtil::getTheBestDisplayValue(displayData, constraints);
if (displayValue == nullptr) {
return nullptr;
}
::std::u16string displayString = displayValue->getDisplayString();
if (displayString.empty()) {
return nullptr;
}

// To make compiler quiet about unused variable.
if (enableInflectionGuess)
return nullptr;

// TODO Implement the rest
Copy link
Member

@grhoten grhoten Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have plans to implement this TODO before merging this pull request?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have some tests failing. My goal is to have tests pass, submit this PR, then open a new one with affecting only this file.
WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a good plan.

return nullptr;
}

} // namespace inflection::grammar::synthesis
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2024 and later: Unicode, Inc. and others.
* License & terms of use: http://www.unicode.org/copyright.html
*/
#pragma once

#include <inflection/dialog/DefaultDisplayFunction.hpp>
#include <inflection/dialog/DictionaryLookupInflector.hpp>
#include <inflection/dictionary/fwd.hpp>
#include <inflection/dictionary/Inflector.hpp>
#include <inflection/grammar/synthesis/fwd.hpp>
#include <inflection/tokenizer/Tokenizer.hpp>
#include <string>
#include <set>
#include <vector>

class inflection::grammar::synthesis::SrGrammarSynthesizer_SrDisplayFunction
: public virtual ::inflection::dialog::DefaultDisplayFunction
{

public:
typedef ::inflection::dialog::DefaultDisplayFunction super;

private:
const ::inflection::dictionary::DictionaryMetaData& dictionary;
const ::inflection::dialog::SemanticFeature* countFeature { };
const ::inflection::dialog::SemanticFeature* genderFeature { };
const ::inflection::dialog::SemanticFeature* partOfSpeechFeature { };
const ::std::unique_ptr<::inflection::tokenizer::Tokenizer> tokenizer;
const ::inflection::dialog::DictionaryLookupInflector dictionaryInflector;

public:
::inflection::dialog::DisplayValue * getDisplayValue(const dialog::SemanticFeatureModel_DisplayData &displayData, const ::std::map<::inflection::dialog::SemanticFeature, ::std::u16string> &constraints, bool enableInflectionGuess) const override;

public:
explicit SrGrammarSynthesizer_SrDisplayFunction(const ::inflection::dialog::SemanticFeatureModel& model);
~SrGrammarSynthesizer_SrDisplayFunction() override;

public:
SrGrammarSynthesizer_SrDisplayFunction(SrGrammarSynthesizer_SrDisplayFunction&) = delete;
SrGrammarSynthesizer_SrDisplayFunction& operator=(const SrGrammarSynthesizer_SrDisplayFunction&) = delete;
};
2 changes: 2 additions & 0 deletions inflection/src/inflection/grammar/synthesis/fwd.hpp
Original file line number Diff line number Diff line change
@@ -92,6 +92,8 @@ namespace inflection
class RuGrammarSynthesizer_RuDisplayFunction;
class RuGrammarSynthesizer_ToPrepositionLookupFunction;
class RuGrammarSynthesizer_WithPrepositionLookupFunction;
class SrGrammarSynthesizer;
class SrGrammarSynthesizer_SrDisplayFunction;
class SvGrammarSynthesizer;
class SvGrammarSynthesizer_ArticleLookupFunction;
class SvGrammarSynthesizer_GenderLookupFunction;
12 changes: 12 additions & 0 deletions inflection/src/inflection/util/LocaleUtils.cpp
Original file line number Diff line number Diff line change
@@ -503,6 +503,18 @@ const ULocale& LocaleUtils::SLOVAKIA()
return *npc(SLOVAKIA_);
}

const ULocale& LocaleUtils::SERBIAN()
{
static auto SERBIAN_ = new ULocale("sr");
return *npc(SERBIAN_);
}

const ULocale& LocaleUtils::SERBIA()
{
static auto SERBIA_ = new ULocale("sr", "RS");
return *npc(SERBIA_);
}

const ULocale& LocaleUtils::SWEDISH()
{
static auto SWEDISH_ = new ULocale("sv");
8 changes: 8 additions & 0 deletions inflection/src/inflection/util/LocaleUtils.hpp
Original file line number Diff line number Diff line change
@@ -440,6 +440,14 @@ class INFLECTION_CLASS_API inflection::util::LocaleUtils final
* sk_SK: Slovak (Slovakia)
*/
static const ::inflection::util::ULocale& SLOVAKIA();
/**
* sr: Serbian
*/
static const ::inflection::util::ULocale& SERBIAN();
/**
* sr_RS: Serbian (Serbia)
*/
static const ::inflection::util::ULocale& SERBIA();
/**
* sv: Swedish
*/
12 changes: 12 additions & 0 deletions inflection/test/resources/inflection/dialog/inflection/sr.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<!--
Copyright 2024 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
<inflectionTest locale="sr">
<!-- Some nominative case tests where we don't expect changes -->
<test><source case="nominative" number="singular">једро</source><result>једро</result></test>
<test><source case="nominative" number="singular">жена</source><result>жена</result></test>
<test><source case="nominative" number="singular">камен</source><result>камен</result></test>
<test><source case="nominative" pos="proper-noun">Петар</source><result>Петар</result></test>
</inflectionTest>
25 changes: 25 additions & 0 deletions inflection/test/resources/inflection/dialog/pronoun/sr.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version='1.0' encoding='utf-8'?>
<!--
Copyright 2024 and later: Unicode, Inc. and others.
License & terms of use: http://www.unicode.org/copyright.html
-->
<inflectionTest locale="sr">
<!-- Simple inflection -->
<test><source person="first" number="plural" case="nominative"/><result>ми</result></test>
<test><source person="first" number="plural"/><result>ми</result></test>
<test><source person="first" number="singular" case="nominative"/><result>ја</result></test>
<test><source person="first" number="singular"/><result>ја</result></test>
<test><source person="first"/><result>ја</result></test>
<test><source person="second" number="plural" case="nominative"/><result>ви</result></test>
<test><source person="second" number="singular" case="nominative"/><result>ти</result></test>
<test><source person="third" number="plural" case="nominative"/><result>она</result></test>
<test><source person="third" number="plural" gender="feminine" case="nominative"/><result>оне</result></test>
<test><source person="third" number="plural" gender="masculine" case="nominative"/><result>они</result></test>
<test><source person="third" number="plural" gender="neuter" case="nominative"/><result>она</result></test>
<test><source person="third" number="singular" case="nominative"/><result>оно</result></test>
<test><source person="third" number="singular" case="nominative"/><result>оно</result></test>
<test><source person="third" number="singular" gender="feminine" case="nominative"/><result>она</result></test>
<test><source person="third" number="singular" gender="masculine" case="nominative"/><result>он</result></test>
<test><source person="third" number="singular" gender="neuter" case="nominative"/><result>оно</result></test>
<test><source/><result>оно</result></test>
</inflectionTest>
2 changes: 2 additions & 0 deletions inflection/test/src/inflection/util/LocaleUtilsTest.cpp
Original file line number Diff line number Diff line change
@@ -99,6 +99,7 @@ TEST_CASE("LocaleUtilsTest#testCoverage")
inflection::util::LocaleUtils::PORTUGUESE(),
inflection::util::LocaleUtils::ROMANIAN(),
inflection::util::LocaleUtils::RUSSIAN(),
inflection::util::LocaleUtils::SERBIAN(),
inflection::util::LocaleUtils::SLOVAK(),
inflection::util::LocaleUtils::SWEDISH(),
inflection::util::LocaleUtils::THAI(),
@@ -158,6 +159,7 @@ TEST_CASE("LocaleUtilsTest#testCoverage")
inflection::util::LocaleUtils::PORTUGAL(),
inflection::util::LocaleUtils::ROMANIA(),
inflection::util::LocaleUtils::RUSSIA(),
inflection::util::LocaleUtils::SERBIA(),
inflection::util::LocaleUtils::SLOVAKIA(),
inflection::util::LocaleUtils::SWEDEN(),
inflection::util::LocaleUtils::THAILAND(),