-
-
Notifications
You must be signed in to change notification settings - Fork 18
Implementing group 3 noun rules for Serbian. #173
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
Changes from all commits
64e1fd0
097fda4
9be78bb
1f37045
49295e3
0a365cc
67ccfcc
b857505
78062a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,4 +18,25 @@ | |
| <!-- test><source case="vocative" number="singular" gender="masculine" pos="noun">уранак</source><result>уранче</result></test --> | ||
| <!-- test><source case="vocative" number="singular" gender="masculine" pos="noun">игроказ</source><result>игрокаже</result></test --> | ||
| <!-- test><source case="vocative" number="singular" gender="masculine" pos="noun">пашњак</source><result>пашњаче</result></test --> | ||
| <!-- Rule based inflection, group 3, all nouns ending with a --> | ||
| <test><source case="instrumental" number="singular" gender="feminine" pos="noun">Италија</source><result>Италијом</result></test> | ||
| <test><source case="instrumental" number="singular" gender="feminine" pos="noun">авенија</source><result>авенијом</result></test> | ||
| <test><source case="locative" number="plural" gender="feminine" pos="noun">авенија</source><result>авенијама</result></test> | ||
| <test><source case="vocative" number="singular" gender="masculine" pos="noun">кадија</source><result>кадија</result></test> | ||
| <test><source case="vocative" number="singular" gender="feminine" pos="noun">уметница</source><result>уметнице</result></test> | ||
| <test><source case="vocative" number="singular" gender="feminine" pos="noun">птица</source><result>птица</result></test> | ||
| <test><source case="vocative" number="singular" gender="feminine" pos="noun">Стана</source><result>Стано</result></test> | ||
| <test><source case="vocative" number="singular" gender="feminine" pos="noun">Зора</source><result>Зоро</result></test> | ||
| <test><source case="vocative" number="singular" gender="masculine" pos="noun">Божа</source><result>Божо</result></test> | ||
| <test><source case="vocative" number="singular" gender="masculine" pos="noun">Љуба</source><result>Љубо</result></test> | ||
| <test><source case="genitive" number="plural" gender="feminine" pos="noun">пратња</source><result>пратњи</result></test> | ||
| <test><source case="genitive" number="plural" gender="feminine" pos="noun">радња</source><result>радњи</result></test> | ||
| <test><source case="genitive" number="plural" gender="feminine" pos="noun">лопта</source><result>лопти</result></test> | ||
| <test><source case="genitive" number="plural" gender="feminine" pos="noun">молба</source><result>молби</result></test> | ||
| <test><source case="genitive" number="plural" gender="feminine" pos="noun">конзерва</source><result>конзерви</result></test> | ||
| <test><source case="genitive" number="plural" gender="feminine" pos="noun">гошћа</source><result>гошћа</result></test> | ||
| <test><source case="genitive" number="plural" gender="feminine" pos="noun">двојка</source><result>двојака</result></test> | ||
| <test><source case="genitive" number="plural" gender="feminine" pos="noun">битка</source><result>битака</result></test> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have a lot of fully fleshed out constraints. Most of the other languages only change specific grammemes. Sometimes you only specify the case, number or gender. The other tests usually specify less. The other languages usually default to noun. These tests are currently fine, but common usage starts from any surface form (ideally a unique surface form), and then you modify just the relevant grammemes.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can probably remove noun info, but I do need a case, gender and number for rule based approach to work. |
||
| <!-- There are some exception, like pripovetka where tk -> dak because of the base word. This has to be dictionary exception --> | ||
| <!-- <test><source case="genitive" number="plural" gender="feminine" pos="noun">приповетка</source><result>приповедака</result></test> --> | ||
| </inflectionTest> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this kind of mapping, you may be inspired by Arabic, German or Italian. They convert a string to a numeric key (makeLookupKey) containing multiple grammemes, and they map the key to a string. This mapping is initialized in the constructor instead of at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the concern the runtime size increase (static constexpr)? If yes, I can remove the static (creating these arrays is cheap).
Otherwise the current approach looks simpler. I will look into refactoring this code as I add more cases, potentially implementing Arabic like approach.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was to make it more scalable, but this is fine too.