Fix Serbian noun synthesis rules for all 4 declension classes (Vrsta I-IV)#198
Open
nciric wants to merge 3 commits into
Open
Fix Serbian noun synthesis rules for all 4 declension classes (Vrsta I-IV)#198nciric wants to merge 3 commits into
nciric wants to merge 3 commits into
Conversation
…I-IV) Implement complete C++ rule-based noun inflection synthesis for Serbian in SrGrammarSynthesizer_SrDisplayFunction: - Vrsta I: Masculine consonant nouns and unexpanded neuter -o/-e nouns. - Vrsta II: Neuter -e nouns with -n- and -t- stem extensions (ime -> imena, dete -> detetu, pile -> pileta). - Vrsta III: Nouns ending in -a (zena, Nikola, kucica). - Vrsta IV: Feminine consonant nouns (i-declension) with instrumental singular iotation (ljubavlju, pamecu, mladoscu, koscu, nocu). - Optimize case index lookup using constexpr getCaseIndex (addressing PR 173 feedback). - Add comprehensive structured test suite coverage for all 4 declension classes in sr.xml.
Split inflectByRuleConsonant into inflectByRuleFeminineConsonant (Class IV) and inflectByRuleMasculineConsonant (Class I) for cleaner modularity and readability. Clean up line indentation.
Apply clang-format with WebKit style, 120 column limit, and NamespaceIndentation: None across SrGrammarSynthesizer_SrDisplayFunction.cpp.
nciric
force-pushed
the
serbian-cpp-synthesis-rules
branch
from
July 21, 2026 01:54
1092dcb to
e4e5621
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements complete C++ rule-based noun inflection synthesis for Serbian (sr) covering all four primary declension classes (Vrste I – IV) in standard Serbian grammar:
-а): Masculine consonant nouns (ученик,прозор,уранак) and unexpanded neuter-о/-еnouns (село,поље,уточиште).-аwith stem extension): Neuter-еnouns expanding stem with-н-(име->имена,време->времена) or-т-(дете->детету,дугме->дугмета,пиле->пилета).-е): Nouns ending in-а(жена,кућица,Никола,пратња,двојка).-и): Feminine consonant nouns (љубављу,памећу,младошћу,кошћу,ноћу).Key Refactorings & Optimizations
std::mapheap allocation per call inapplySuffixwith aconstexpr size_t getCaseIndex(std::u16string_view targetCase)helper function (addressing George's feedback in PR Implementing group 3 noun rules for Serbian. #173).-штеNeuters: Excluded Class I-штеneuters (уточиште,положиште) from Class II-ет-stem extension.Note on Suffix Guessing PR #197
Testing
make check -j8against ICU 78 (263test cases,290,506assertions passed 100%).