From dff19546f93591f292dbf501d1720a8e0b025cb7 Mon Sep 17 00:00:00 2001 From: Danila Bogomolov Date: Sun, 28 Jan 2024 23:40:19 +0300 Subject: [PATCH] fix indexes for gender naming options --- num2words/lang_RU.py | 4 ++-- tests/test_ru.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/num2words/lang_RU.py b/num2words/lang_RU.py index 2ff1c0a0..5dbcea78 100644 --- a/num2words/lang_RU.py +++ b/num2words/lang_RU.py @@ -22,8 +22,8 @@ GENDER_PLURAL_INDEXES = { 'm': 0, 'masculine': 0, 'м': 0, 'мужской': 0, - 'f': 1, 'feminine': 1, 'ж': 0, 'женский': 0, - 'n': 2, 'neuter': 2, 'с': 0, 'средний': 0, + 'f': 1, 'feminine': 1, 'ж': 1, 'женский': 1, + 'n': 2, 'neuter': 2, 'с': 2, 'средний': 2, 'p': 3, 'plural': 3 } CASE_INDEXES = { diff --git a/tests/test_ru.py b/tests/test_ru.py index 206873c4..d9574351 100644 --- a/tests/test_ru.py +++ b/tests/test_ru.py @@ -77,6 +77,7 @@ def test_cardinal(self): def test_cardinal_feminine(self): self.assertEqual(num2words(1, lang='ru', gender='f'), 'одна') + self.assertEqual(num2words(1, lang='ru', gender='ж'), 'одна') self.assertEqual(num2words(2, lang='ru', gender='f'), 'две') self.assertEqual(num2words(3, lang='ru', gender='f'), 'три') self.assertEqual(num2words(100, lang='ru', gender='f'), "сто")