improving recognition
This commit is contained in:
parent
ac5ea38c9f
commit
40388ffbb3
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,168 +1,193 @@
|
|||||||
FIRST_A_IFORM_SINGULAR;NGC_P1_NOMINATIVE;а;рука
|
Склонение;Род;Падеж;Окончание;Пример
|
||||||
;NGC_P2_GENITIVE;и;подарок для руки
|
FIRST_A_IFORM_INANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;а;рука
|
||||||
;NGC_P3_DATIVE;е;подарок руке
|
;;NGC_P2_GENITIVE;и;подарок для руки
|
||||||
;NGC_P4_ACCUSATIVE;у;обвиняю руку
|
;;NGC_P3_DATIVE;е;подарок руке
|
||||||
;NGC_P5_INSTRUMENTAL;ой;говорю с рукой
|
;;NGC_P4_ACCUSATIVE;у;обвиняю руку
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о руке
|
;;NGC_P5_INSTRUMENTAL;ой;говорю с рукой
|
||||||
FIRST_A_IFORM_INANIMATE_PLURAL;NGC_P1_NOMINATIVE;и;руки
|
;;NGC_P6_PREPOSITIONAL;е;говорю о руке
|
||||||
;NGC_P2_GENITIVE;;подарок для рук
|
;NC_PLURAL;NGC_P1_NOMINATIVE;и;руки
|
||||||
;NGC_P3_DATIVE;е;подарок рукам
|
;;NGC_P2_GENITIVE;;подарок для рук
|
||||||
;NGC_P4_ACCUSATIVE;и;обвиняю руки
|
;;NGC_P3_DATIVE;е;подарок рукам
|
||||||
;NGC_P5_INSTRUMENTAL;ами;говорю с руками
|
;;NGC_P4_ACCUSATIVE;и;обвиняю руки
|
||||||
;NGC_P6_PREPOSITIONAL;ах;говорю о руках
|
;;NGC_P5_INSTRUMENTAL;ами;говорю с руками
|
||||||
FIRST_A_IFORM_ANIMATE_PLURAL;NGC_P1_NOMINATIVE;и;бабушки
|
;;NGC_P6_PREPOSITIONAL;ах;говорю о руках
|
||||||
;NGC_P2_GENITIVE;;подарок для бабушек
|
FIRST_A_IFORM_ANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;а;бабушка
|
||||||
;NGC_P3_DATIVE;е;подарок бабушкам
|
;;NGC_P2_GENITIVE;и;подарок для бабушки
|
||||||
;NGC_P4_ACCUSATIVE;;обвиняю бабушек
|
;;NGC_P3_DATIVE;е;подарок бабушке
|
||||||
;NGC_P5_INSTRUMENTAL;ами;говорю с бабушками
|
;;NGC_P4_ACCUSATIVE;у;обвиняю бабушку
|
||||||
;NGC_P6_PREPOSITIONAL;ах;говорю о бабушках
|
;;NGC_P5_INSTRUMENTAL;ой;говорю с бабушкой
|
||||||
FIRST_A_UFORM_SINGULAR;NGC_P1_NOMINATIVE;а;лапа
|
;;NGC_P6_PREPOSITIONAL;е;говорю о бабушке
|
||||||
;NGC_P2_GENITIVE;ы;подарок для лапы
|
;NC_PLURAL;NGC_P1_NOMINATIVE;и;бабушки
|
||||||
;NGC_P3_DATIVE;е;подарок лапе
|
;;NGC_P2_GENITIVE;;подарок для бабушек
|
||||||
;NGC_P4_ACCUSATIVE;у;обвиняю лапу
|
;;NGC_P3_DATIVE;е;подарок бабушкам
|
||||||
;NGC_P5_INSTRUMENTAL;ой;говорю с лапой
|
;;NGC_P4_ACCUSATIVE;;обвиняю бабушек
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о лапе
|
;;NGC_P5_INSTRUMENTAL;ами;говорю с бабушками
|
||||||
FIRST_A_UFORM_INANIMATE_PLURAL;NGC_P1_NOMINATIVE;ы;лапы
|
;;NGC_P6_PREPOSITIONAL;ах;говорю о бабушках
|
||||||
;NGC_P2_GENITIVE;;подарок для лап
|
FIRST_A_UFORM_INANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;а;лапа
|
||||||
;NGC_P3_DATIVE;ам;подарок лапам
|
;;NGC_P2_GENITIVE;ы;подарок для лапы
|
||||||
;NGC_P4_ACCUSATIVE;ы;обвиняю лапы
|
;;NGC_P3_DATIVE;е;подарок лапе
|
||||||
;NGC_P5_INSTRUMENTAL;ами;говорю с лапами
|
;;NGC_P4_ACCUSATIVE;у;обвиняю лапу
|
||||||
;NGC_P6_PREPOSITIONAL;ах;говорю о лапах
|
;;NGC_P5_INSTRUMENTAL;ой;говорю с лапой
|
||||||
FIRST_A_UFORM_ANIMATE_PLURAL;NGC_P1_NOMINATIVE;ы;папы
|
;;NGC_P6_PREPOSITIONAL;е;говорю о лапе
|
||||||
;NGC_P2_GENITIVE;;подарок для пап
|
;NC_PLURAL;NGC_P1_NOMINATIVE;ы;лапы
|
||||||
;NGC_P3_DATIVE;ам;подарок папам
|
;;NGC_P2_GENITIVE;;подарок для лап
|
||||||
;NGC_P4_ACCUSATIVE;;обвиняю пап
|
;;NGC_P3_DATIVE;ам;подарок лапам
|
||||||
;NGC_P5_INSTRUMENTAL;ами;говорю с папами
|
;;NGC_P4_ACCUSATIVE;ы;обвиняю лапы
|
||||||
;NGC_P6_PREPOSITIONAL;ах;говорю о папах
|
;;NGC_P5_INSTRUMENTAL;ами;говорю с лапами
|
||||||
FIRST_YA_FORM_SINGULAR;NGC_P1_NOMINATIVE;я;пуля
|
;;NGC_P6_PREPOSITIONAL;ах;говорю о лапах
|
||||||
;NGC_P2_GENITIVE;и;подарок для пули
|
FIRST_A_UFORM_ANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;а;папа
|
||||||
;NGC_P3_DATIVE;е;подарок пуле
|
;;NGC_P2_GENITIVE;ы;подарок для папы
|
||||||
;NGC_P4_ACCUSATIVE;ю;обвиняю пулю
|
;;NGC_P3_DATIVE;е;подарок папе
|
||||||
;NGC_P5_INSTRUMENTAL;ей;говорю с пулей
|
;;NGC_P4_ACCUSATIVE;у;обвиняю папу
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о пуле
|
;;NGC_P5_INSTRUMENTAL;ой;говорю с папой
|
||||||
FIRST_YA_FORM_INANIMATE_PLURAL;NGC_P1_NOMINATIVE;и;пули
|
;;NGC_P6_PREPOSITIONAL;е;говорю о папе
|
||||||
;NGC_P2_GENITIVE;ь;подарок для пуль
|
;NC_PLURAL;NGC_P1_NOMINATIVE;ы;папы
|
||||||
;NGC_P3_DATIVE;ям;подарок пулям
|
;;NGC_P2_GENITIVE;;подарок для пап
|
||||||
;NGC_P4_ACCUSATIVE;и;обвиняю пули
|
;;NGC_P3_DATIVE;ам;подарок папам
|
||||||
;NGC_P5_INSTRUMENTAL;ями;говорю с пулями
|
;;NGC_P4_ACCUSATIVE;;обвиняю пап
|
||||||
;NGC_P6_PREPOSITIONAL;ях;говорю о пулях
|
;;NGC_P5_INSTRUMENTAL;ами;говорю с папами
|
||||||
FIRST_YA_FORM_ANIMATE_PLURAL;NGC_P1_NOMINATIVE;и;тети
|
;;NGC_P6_PREPOSITIONAL;ах;говорю о папах
|
||||||
;NGC_P2_GENITIVE;ь;подарок для теть
|
FIRST_YA_FORM_INANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;я;пуля
|
||||||
;NGC_P3_DATIVE;ям;подарок тетям
|
;;NGC_P2_GENITIVE;и;подарок для пули
|
||||||
;NGC_P4_ACCUSATIVE;ь;обвиняю теть
|
;;NGC_P3_DATIVE;е;подарок пуле
|
||||||
;NGC_P5_INSTRUMENTAL;ями;говорю с тетями
|
;;NGC_P4_ACCUSATIVE;ю;обвиняю пулю
|
||||||
;NGC_P6_PREPOSITIONAL;ях;говорю о тетях
|
;;NGC_P5_INSTRUMENTAL;ей;говорю с пулей
|
||||||
SECOND_MALE_IFORM_INANIMATE_SINGULAR;NGC_P1_NOMINATIVE;;бук
|
;;NGC_P6_PREPOSITIONAL;е;говорю о пуле
|
||||||
;NGC_P2_GENITIVE;а;подарок для бука
|
;NC_PLURAL;NGC_P1_NOMINATIVE;и;пули
|
||||||
;NGC_P3_DATIVE;у;подарок буку
|
;;NGC_P2_GENITIVE;ь;подарок для пуль
|
||||||
;NGC_P4_ACCUSATIVE;;обвиняю бук
|
;;NGC_P3_DATIVE;ям;подарок пулям
|
||||||
;NGC_P5_INSTRUMENTAL;ом;говорю с буком
|
;;NGC_P4_ACCUSATIVE;и;обвиняю пули
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о буке
|
;;NGC_P5_INSTRUMENTAL;ями;говорю с пулями
|
||||||
SECOND_MALE_IFORM_INANIMATE_PLURAL;NGC_P1_NOMINATIVE;и;буки
|
;;NGC_P6_PREPOSITIONAL;ях;говорю о пулях
|
||||||
;NGC_P2_GENITIVE;ов;подарок для буков
|
FIRST_YA_FORM_ANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;я;тетя
|
||||||
;NGC_P3_DATIVE;у;подарок букам
|
;;NGC_P2_GENITIVE;и;подарок для тети
|
||||||
;NGC_P4_ACCUSATIVE;и;обвиняю буки
|
;;NGC_P3_DATIVE;е;подарок тете
|
||||||
;NGC_P5_INSTRUMENTAL;ами;говорю с буками
|
;;NGC_P4_ACCUSATIVE;ю;обвиняю тетю
|
||||||
;NGC_P6_PREPOSITIONAL;ах;говорю о буках
|
;;NGC_P5_INSTRUMENTAL;ей;говорю с тетей
|
||||||
SECOND_MALE_IFORM_ANIMATE_SINGULAR;NGC_P1_NOMINATIVE;;рыбак
|
;;NGC_P6_PREPOSITIONAL;е;говорю о тете
|
||||||
;NGC_P2_GENITIVE;а;подарок для рыбака
|
;NC_PLURAL;NGC_P1_NOMINATIVE;и;тети
|
||||||
;NGC_P3_DATIVE;у;подарок рыбаку
|
;;NGC_P2_GENITIVE;ь;подарок для теть
|
||||||
;NGC_P4_ACCUSATIVE;а;обвиняю рыбака
|
;;NGC_P3_DATIVE;ям;подарок тетям
|
||||||
;NGC_P5_INSTRUMENTAL;ом;говорю с рыбаком
|
;;NGC_P4_ACCUSATIVE;ь;обвиняю теть
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о рыбаке
|
;;NGC_P5_INSTRUMENTAL;ями;говорю с тетями
|
||||||
SECOND_MALE_IFORM_ANIMATE_PLURAL;NGC_P1_NOMINATIVE;и;рыбаки
|
;;NGC_P6_PREPOSITIONAL;ях;говорю о тетях
|
||||||
;NGC_P2_GENITIVE;ов;подарок для рыбаков
|
SECOND_MALE_IFORM_INANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;;бук
|
||||||
;NGC_P3_DATIVE;ам;подарок рыбакам
|
;;NGC_P2_GENITIVE;а;подарок для бука
|
||||||
;NGC_P4_ACCUSATIVE;ов;обвиняю рыбаков
|
;;NGC_P3_DATIVE;у;подарок буку
|
||||||
;NGC_P5_INSTRUMENTAL;ами;говорю с рыбаками
|
;;NGC_P4_ACCUSATIVE;;обвиняю бук
|
||||||
;NGC_P6_PREPOSITIONAL;ах;говорю о рыбаках
|
;;NGC_P5_INSTRUMENTAL;ом;говорю с буком
|
||||||
SECOND_MALE_UFORM_INANIMATE_SINGULAR;NGC_P1_NOMINATIVE;;зад
|
;;NGC_P6_PREPOSITIONAL;е;говорю о буке
|
||||||
;NGC_P2_GENITIVE;а;подарок для зада
|
;NC_PLURAL;NGC_P1_NOMINATIVE;и;буки
|
||||||
;NGC_P3_DATIVE;у;подарок заду
|
;;NGC_P2_GENITIVE;ов;подарок для буков
|
||||||
;NGC_P4_ACCUSATIVE;;обвиняю зад
|
;;NGC_P3_DATIVE;ам;подарок букам
|
||||||
;NGC_P5_INSTRUMENTAL;ом;говорю с задом
|
;;NGC_P4_ACCUSATIVE;и;обвиняю буки
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о заде
|
;;NGC_P5_INSTRUMENTAL;ами;говорю с буками
|
||||||
SECOND_MALE_UFORM_INANIMATE_PLURAL;NGC_P1_NOMINATIVE;ы;зады
|
;;NGC_P6_PREPOSITIONAL;ах;говорю о буках
|
||||||
;NGC_P2_GENITIVE;ов;подарок для задов
|
SECOND_MALE_IFORM_ANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;;рыбак
|
||||||
;NGC_P3_DATIVE;ам;подарок задам
|
;;NGC_P2_GENITIVE;а;подарок для рыбака
|
||||||
;NGC_P4_ACCUSATIVE;ы;обвиняю зады
|
;;NGC_P3_DATIVE;у;подарок рыбаку
|
||||||
;NGC_P5_INSTRUMENTAL;ами;говорю с задами
|
;;NGC_P4_ACCUSATIVE;а;обвиняю рыбака
|
||||||
;NGC_P6_PREPOSITIONAL;ах;говорю о задах
|
;;NGC_P5_INSTRUMENTAL;ом;говорю с рыбаком
|
||||||
SECOND_MALE_UFORM_ANIMATE_SINGULAR;NGC_P1_NOMINATIVE;;кит
|
;;NGC_P6_PREPOSITIONAL;е;говорю о рыбаке
|
||||||
;NGC_P2_GENITIVE;а;подарок для кита
|
;NC_PLURAL;NGC_P1_NOMINATIVE;и;рыбаки
|
||||||
;NGC_P3_DATIVE;у;подарок киту
|
;;NGC_P2_GENITIVE;ов;подарок для рыбаков
|
||||||
;NGC_P4_ACCUSATIVE;а;обвиняю кита
|
;;NGC_P3_DATIVE;ам;подарок рыбакам
|
||||||
;NGC_P5_INSTRUMENTAL;ом;говорю с китом
|
;;NGC_P4_ACCUSATIVE;ов;обвиняю рыбаков
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о ките
|
;;NGC_P5_INSTRUMENTAL;ами;говорю с рыбаками
|
||||||
SECOND_MALE_UFORM_ANIMATE_PLURAL;NGC_P1_NOMINATIVE;ы;киты
|
;;NGC_P6_PREPOSITIONAL;ах;говорю о рыбаках
|
||||||
;NGC_P2_GENITIVE;ов;подарок для китов
|
SECOND_MALE_UFORM_INANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;;зад
|
||||||
;NGC_P3_DATIVE;ам;подарок китам
|
;;NGC_P2_GENITIVE;а;подарок для зада
|
||||||
;NGC_P4_ACCUSATIVE;ов;обвиняю китов
|
;;NGC_P3_DATIVE;у;подарок заду
|
||||||
;NGC_P5_INSTRUMENTAL;ами;говорю с китами
|
;;NGC_P4_ACCUSATIVE;;обвиняю зад
|
||||||
;NGC_P6_PREPOSITIONAL;ах;говорю о китах
|
;;NGC_P5_INSTRUMENTAL;ом;говорю с задом
|
||||||
SECOND_MALE_SSFORM_INANIMATE_SINGULAR;NGC_P1_NOMINATIVE;ь;тополь
|
;;NGC_P6_PREPOSITIONAL;е;говорю о заде
|
||||||
;NGC_P2_GENITIVE;я;подарок для тополя
|
;NC_PLURAL;NGC_P1_NOMINATIVE;ы;зады
|
||||||
;NGC_P3_DATIVE;ю;подарок тополю
|
;;NGC_P2_GENITIVE;ов;подарок для задов
|
||||||
;NGC_P4_ACCUSATIVE;ь;обвиняю тополь
|
;;NGC_P3_DATIVE;ам;подарок задам
|
||||||
;NGC_P5_INSTRUMENTAL;ем;говорю с тополем
|
;;NGC_P4_ACCUSATIVE;ы;обвиняю зады
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о тополе
|
;;NGC_P5_INSTRUMENTAL;ами;говорю с задами
|
||||||
SECOND_MALE_SSFORM_INANIMATE_PLURAL;NGC_P1_NOMINATIVE;и;тополи
|
;;NGC_P6_PREPOSITIONAL;ах;говорю о задах
|
||||||
;NGC_P2_GENITIVE;ей;подарок для тополей
|
SECOND_MALE_UFORM_ANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;;кит
|
||||||
;NGC_P3_DATIVE;ям;подарок тополям
|
;;NGC_P2_GENITIVE;а;подарок для кита
|
||||||
;NGC_P4_ACCUSATIVE;и;обвиняю тополи
|
;;NGC_P3_DATIVE;у;подарок киту
|
||||||
;NGC_P5_INSTRUMENTAL;ями;говорю с тополями
|
;;NGC_P4_ACCUSATIVE;а;обвиняю кита
|
||||||
;NGC_P6_PREPOSITIONAL;ях;говорю о тополях
|
;;NGC_P5_INSTRUMENTAL;ом;говорю с китом
|
||||||
SECOND_MALE_SSFORM_ANIMATE_SINGULAR;NGC_P1_NOMINATIVE;ь;парень
|
;;NGC_P6_PREPOSITIONAL;е;говорю о ките
|
||||||
;NGC_P2_GENITIVE;я;подарок для парня
|
;NC_PLURAL;NGC_P1_NOMINATIVE;ы;киты
|
||||||
;NGC_P3_DATIVE;ю;подарок парню
|
;;NGC_P2_GENITIVE;ов;подарок для китов
|
||||||
;NGC_P4_ACCUSATIVE;я;обвиняю парня
|
;;NGC_P3_DATIVE;ам;подарок китам
|
||||||
;NGC_P5_INSTRUMENTAL;ем;говорю с парнем
|
;;NGC_P4_ACCUSATIVE;ов;обвиняю китов
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о парне
|
;;NGC_P5_INSTRUMENTAL;ами;говорю с китами
|
||||||
SECOND_MALE_SSFORM_ANIMATE_PLURAL;NGC_P1_NOMINATIVE;и;парни
|
;;NGC_P6_PREPOSITIONAL;ах;говорю о китах
|
||||||
;NGC_P2_GENITIVE;ей;подарок для парней
|
SECOND_MALE_SSFORM_INANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;ь;тополь
|
||||||
;NGC_P3_DATIVE;ям;подарок парням
|
;;NGC_P2_GENITIVE;я;подарок для тополя
|
||||||
;NGC_P4_ACCUSATIVE;ей;обвиняю парней
|
;;NGC_P3_DATIVE;ю;подарок тополю
|
||||||
;NGC_P5_INSTRUMENTAL;ями;говорю с парнями
|
;;NGC_P4_ACCUSATIVE;ь;обвиняю тополь
|
||||||
;NGC_P6_PREPOSITIONAL;ях;говорю о парнях
|
;;NGC_P5_INSTRUMENTAL;ем;говорю с тополем
|
||||||
SECOND_NEUTRAL_E_FORM_SINGULAR;NGC_P1_NOMINATIVE;е;поле
|
;;NGC_P6_PREPOSITIONAL;е;говорю о тополе
|
||||||
;NGC_P2_GENITIVE;я;подарок для поля
|
;NC_PLURAL;NGC_P1_NOMINATIVE;и;тополи
|
||||||
;NGC_P3_DATIVE;ю;подарок полю
|
;;NGC_P2_GENITIVE;ей;подарок для тополей
|
||||||
;NGC_P4_ACCUSATIVE;е;обвиняю поле
|
;;NGC_P3_DATIVE;ям;подарок тополям
|
||||||
;NGC_P5_INSTRUMENTAL;ем;говорю с полем
|
;;NGC_P4_ACCUSATIVE;и;обвиняю тополи
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о поле
|
;;NGC_P5_INSTRUMENTAL;ями;говорю с тополями
|
||||||
SECOND_NEUTRAL_E_FORM_PLURAL;NGC_P1_NOMINATIVE;я;поля
|
;;NGC_P6_PREPOSITIONAL;ях;говорю о тополях
|
||||||
;NGC_P2_GENITIVE;ей;подарок для полей
|
SECOND_MALE_SSFORM_ANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;ь;парень
|
||||||
;NGC_P3_DATIVE;ям;подарок полям
|
;;NGC_P2_GENITIVE;я;подарок для парня
|
||||||
;NGC_P4_ACCUSATIVE;я;обвиняю поля
|
;;NGC_P3_DATIVE;ю;подарок парню
|
||||||
;NGC_P5_INSTRUMENTAL;ями;говорю с полями
|
;;NGC_P4_ACCUSATIVE;я;обвиняю парня
|
||||||
;NGC_P6_PREPOSITIONAL;ях;говорю о полях
|
;;NGC_P5_INSTRUMENTAL;ем;говорю с парнем
|
||||||
SECOND_NEUTRAL_O_FORM_SINGULAR;NGC_P1_NOMINATIVE;о;тело
|
;;NGC_P6_PREPOSITIONAL;е;говорю о парне
|
||||||
;NGC_P2_GENITIVE;а;подарок для тела
|
;NC_PLURAL;NGC_P1_NOMINATIVE;и;парни
|
||||||
;NGC_P3_DATIVE;у;подарок телу
|
;;NGC_P2_GENITIVE;ей;подарок для парней
|
||||||
;NGC_P4_ACCUSATIVE;о;обвиняю тело
|
;;NGC_P3_DATIVE;ям;подарок парням
|
||||||
;NGC_P5_INSTRUMENTAL;ом;говорю с телом
|
;;NGC_P4_ACCUSATIVE;ей;обвиняю парней
|
||||||
;NGC_P6_PREPOSITIONAL;е;говорю о теле
|
;;NGC_P5_INSTRUMENTAL;ями;говорю с парнями
|
||||||
SECOND_NEUTRAL_O_FORM_PLURAL;NGC_P1_NOMINATIVE;а;тела
|
;;NGC_P6_PREPOSITIONAL;ях;говорю о парнях
|
||||||
;NGC_P2_GENITIVE;;подарок для тел
|
SECOND_NEUTRAL_E_FORM;NC_SINGULAR;NGC_P1_NOMINATIVE;е;поле
|
||||||
;NGC_P3_DATIVE;ам;подарок телам
|
;;NGC_P2_GENITIVE;я;подарок для поля
|
||||||
;NGC_P4_ACCUSATIVE;а;обвиняю тела
|
;;NGC_P3_DATIVE;ю;подарок полю
|
||||||
;NGC_P5_INSTRUMENTAL;ами;говорю с телами
|
;;NGC_P4_ACCUSATIVE;е;обвиняю поле
|
||||||
;NGC_P6_PREPOSITIONAL;ах;говорю о телах
|
;;NGC_P5_INSTRUMENTAL;ем;говорю с полем
|
||||||
THIRD_FORM_SINGULAR;NGC_P1_NOMINATIVE;ь;площадь
|
;;NGC_P6_PREPOSITIONAL;е;говорю о поле
|
||||||
;NGC_P2_GENITIVE;и;подарок для площади
|
;NC_PLURAL;NGC_P1_NOMINATIVE;я;поля
|
||||||
;NGC_P3_DATIVE;и;подарок площади
|
;;NGC_P2_GENITIVE;ей;подарок для полей
|
||||||
;NGC_P4_ACCUSATIVE;ь;обвиняю площадь
|
;;NGC_P3_DATIVE;ям;подарок полям
|
||||||
;NGC_P5_INSTRUMENTAL;ью;говорю с площадью
|
;;NGC_P4_ACCUSATIVE;я;обвиняю поля
|
||||||
;NGC_P6_PREPOSITIONAL;и;говорю о площади
|
;;NGC_P5_INSTRUMENTAL;ями;говорю с полями
|
||||||
THIRD_FORM_INANIMATE_PLURAL;NGC_P1_NOMINATIVE;и;площади
|
;;NGC_P6_PREPOSITIONAL;ях;говорю о полях
|
||||||
;NGC_P2_GENITIVE;ей;подарок для площадей
|
SECOND_NEUTRAL_O_FORM;NC_SINGULAR;NGC_P1_NOMINATIVE;о;тело
|
||||||
;NGC_P3_DATIVE;ям;подарок площадям
|
;;NGC_P2_GENITIVE;а;подарок для тела
|
||||||
;NGC_P4_ACCUSATIVE;и;обвиняю площади
|
;;NGC_P3_DATIVE;у;подарок телу
|
||||||
;NGC_P5_INSTRUMENTAL;ями;говорю с площадями
|
;;NGC_P4_ACCUSATIVE;о;обвиняю тело
|
||||||
;NGC_P6_PREPOSITIONAL;ях;говорю о площадях
|
;;NGC_P5_INSTRUMENTAL;ом;говорю с телом
|
||||||
THIRD_FORM_ANIMATE_PLURAL;NGC_P1_NOMINATIVE;и;лошади
|
;;NGC_P6_PREPOSITIONAL;е;говорю о теле
|
||||||
;NGC_P2_GENITIVE;ей;подарок для лошадей
|
;NC_PLURAL;NGC_P1_NOMINATIVE;а;тела
|
||||||
;NGC_P3_DATIVE;ям;подарок лошадям
|
;;NGC_P2_GENITIVE;;подарок для тел
|
||||||
;NGC_P4_ACCUSATIVE;ей;обвиняю лошадей
|
;;NGC_P3_DATIVE;ам;подарок телам
|
||||||
;NGC_P5_INSTRUMENTAL;ями;говорю с лошадями
|
;;NGC_P4_ACCUSATIVE;а;обвиняю тела
|
||||||
;NGC_P6_PREPOSITIONAL;ях;говорю о лошадях
|
;;NGC_P5_INSTRUMENTAL;ами;говорю с телами
|
||||||
|
;;NGC_P6_PREPOSITIONAL;ах;говорю о телах
|
||||||
|
THIRD_FORM_INANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;ь;площадь
|
||||||
|
;;NGC_P2_GENITIVE;и;подарок для площади
|
||||||
|
;;NGC_P3_DATIVE;и;подарок площади
|
||||||
|
;;NGC_P4_ACCUSATIVE;ь;обвиняю площадь
|
||||||
|
;;NGC_P5_INSTRUMENTAL;ью;говорю с площадью
|
||||||
|
;;NGC_P6_PREPOSITIONAL;и;говорю о площади
|
||||||
|
;NC_PLURAL;NGC_P1_NOMINATIVE;и;площади
|
||||||
|
;;NGC_P2_GENITIVE;ей;подарок для площадей
|
||||||
|
;;NGC_P3_DATIVE;ям;подарок площадям
|
||||||
|
;;NGC_P4_ACCUSATIVE;и;обвиняю площади
|
||||||
|
;;NGC_P5_INSTRUMENTAL;ями;говорю с площадями
|
||||||
|
;;NGC_P6_PREPOSITIONAL;ях;говорю о площадях
|
||||||
|
THIRD_FORM_ANIMATE;NC_SINGULAR;NGC_P1_NOMINATIVE;ь;лошадь
|
||||||
|
;;NGC_P2_GENITIVE;и;подарок для лошади
|
||||||
|
;;NGC_P3_DATIVE;и;подарок лошади
|
||||||
|
;;NGC_P4_ACCUSATIVE;ь;обвиняю лошадь
|
||||||
|
;;NGC_P5_INSTRUMENTAL;ью;говорю с лошадью
|
||||||
|
;;NGC_P6_PREPOSITIONAL;и;говорю о лошади
|
||||||
|
;NC_PLURAL;NGC_P1_NOMINATIVE;и;лошади
|
||||||
|
;;NGC_P2_GENITIVE;ей;подарок для лошадей
|
||||||
|
;;NGC_P3_DATIVE;ям;подарок лошадям
|
||||||
|
;;NGC_P4_ACCUSATIVE;ей;обвиняю лошадей
|
||||||
|
;;NGC_P5_INSTRUMENTAL;ями;говорю с лошадями
|
||||||
|
;;NGC_P6_PREPOSITIONAL;ях;говорю о лошадях
|
||||||
|
|
Binary file not shown.
@ -159,7 +159,8 @@ namespace http {
|
|||||||
|
|
||||||
nounTree.put(L"id", id);
|
nounTree.put(L"id", id);
|
||||||
nounTree.put(L"grammaticalCase", NounGrammaticalCaseToWString(nounStruct.nounGrammaticalCase));
|
nounTree.put(L"grammaticalCase", NounGrammaticalCaseToWString(nounStruct.nounGrammaticalCase));
|
||||||
|
nounTree.put(L"animated", nounStruct.animated);
|
||||||
|
nounTree.put(L"count", NounCountToWString(nounStruct.nounCount));
|
||||||
nounTree.put(L"canBeAnimate", nounStruct.nounRecord.canBeAnimate);
|
nounTree.put(L"canBeAnimate", nounStruct.nounRecord.canBeAnimate);
|
||||||
nounTree.put(L"canBeInanimate", nounStruct.nounRecord.canBeInanimate);
|
nounTree.put(L"canBeInanimate", nounStruct.nounRecord.canBeInanimate);
|
||||||
nounTree.put(L"gender", nounStruct.nounRecord.gender);
|
nounTree.put(L"gender", nounStruct.nounRecord.gender);
|
||||||
|
@ -12,7 +12,8 @@ int main()
|
|||||||
LoadNounDeclencionCaseTable();
|
LoadNounDeclencionCaseTable();
|
||||||
LoadFrequentWordSet();
|
LoadFrequentWordSet();
|
||||||
|
|
||||||
RecognizeNoun(L"стульями");
|
//RecognizeNoun(L"стульями");
|
||||||
|
//Косяк: "вечер"
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,8 @@ NounRecord::NounRecord()
|
|||||||
, haveMultipleForm(false)
|
, haveMultipleForm(false)
|
||||||
, haveStandardMultipleForm(false)
|
, haveStandardMultipleForm(false)
|
||||||
, haveStandardMultipleFormWithMissingLastVowel(false)
|
, haveStandardMultipleFormWithMissingLastVowel(false)
|
||||||
|
, haveStandardMultipleFormEnding(false)
|
||||||
|
, haveAlternativeMultipleFormEnding(false)
|
||||||
, canBeAnimate(false)
|
, canBeAnimate(false)
|
||||||
, canBeInanimate(false)
|
, canBeInanimate(false)
|
||||||
{
|
{
|
||||||
@ -53,11 +55,14 @@ NounRecord::NounRecord(std::wstring line)
|
|||||||
|
|
||||||
haveStandardMultipleFormWithMissingLastVowel = lineArr[6] == L"1" ? true : false;
|
haveStandardMultipleFormWithMissingLastVowel = lineArr[6] == L"1" ? true : false;
|
||||||
|
|
||||||
|
haveStandardMultipleFormEnding = lineArr[7] == L"1" ? true : false;
|
||||||
|
|
||||||
specialMultipleForm = lineArr[7];
|
haveAlternativeMultipleFormEnding = lineArr[8] == L"1" ? true : false;
|
||||||
|
|
||||||
canBeAnimate = lineArr[8] == L"1" ? true : false;
|
specialMultipleForm = lineArr[9];
|
||||||
canBeInanimate = lineArr[9] == L"1" ? true : false;
|
|
||||||
|
canBeAnimate = lineArr[10] == L"1" ? true : false;
|
||||||
|
canBeInanimate = lineArr[11] == L"1" ? true : false;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -66,124 +71,107 @@ NounRecord::NounRecord(std::wstring line)
|
|||||||
NounDeclencion WStringToNounDeclencion(std::wstring str)
|
NounDeclencion WStringToNounDeclencion(std::wstring str)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (str == L"FIRST_A_IFORM_SINGULAR")
|
if (str == L"FIRST_A_IFORM_INANIMATE")
|
||||||
{
|
{
|
||||||
return FIRST_A_IFORM_SINGULAR;
|
return FIRST_A_IFORM_INANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"FIRST_A_IFORM_INANIMATE_PLURAL")
|
if (str == L"FIRST_A_IFORM_ANIMATE")
|
||||||
{
|
{
|
||||||
return FIRST_A_IFORM_INANIMATE_PLURAL;
|
return FIRST_A_IFORM_INANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"FIRST_A_IFORM_ANIMATE_PLURAL")
|
if (str == L"FIRST_A_UFORM_INANIMATE")
|
||||||
{
|
{
|
||||||
return FIRST_A_IFORM_ANIMATE_PLURAL;
|
return FIRST_A_UFORM_INANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"FIRST_A_UFORM_SINGULAR")
|
if (str == L"FIRST_A_UFORM_ANIMATE")
|
||||||
{
|
{
|
||||||
return FIRST_A_UFORM_SINGULAR;
|
return FIRST_A_UFORM_ANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"FIRST_A_UFORM_INANIMATE_PLURAL")
|
if (str == L"FIRST_YA_FORM_INANIMATE")
|
||||||
{
|
{
|
||||||
return FIRST_A_UFORM_INANIMATE_PLURAL;
|
return FIRST_YA_FORM_INANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"FIRST_A_UFORM_ANIMATE_PLURAL")
|
if (str == L"FIRST_YA_FORM_ANIMATE")
|
||||||
{
|
{
|
||||||
return FIRST_A_UFORM_ANIMATE_PLURAL;
|
return FIRST_YA_FORM_ANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"FIRST_YA_FORM_SINGULAR")
|
|
||||||
|
if (str == L"SECOND_MALE_IFORM_INANIMATE")
|
||||||
{
|
{
|
||||||
return FIRST_YA_FORM_SINGULAR;
|
return SECOND_MALE_IFORM_INANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"FIRST_YA_FORM_INANIMATE_PLURAL")
|
if (str == L"SECOND_MALE_IFORM_ANIMATE")
|
||||||
{
|
{
|
||||||
return FIRST_YA_FORM_INANIMATE_PLURAL;
|
return SECOND_MALE_IFORM_ANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"FIRST_YA_FORM_ANIMATE_PLURAL")
|
if (str == L"SECOND_MALE_UFORM_INANIMATE")
|
||||||
{
|
{
|
||||||
return FIRST_YA_FORM_ANIMATE_PLURAL;
|
return SECOND_MALE_UFORM_INANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"SECOND_MALE_IFORM_INANIMATE_SINGULAR")
|
if (str == L"SECOND_MALE_UFORM_ANIMATE")
|
||||||
{
|
{
|
||||||
return SECOND_MALE_IFORM_INANIMATE_SINGULAR;
|
return SECOND_MALE_UFORM_ANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"SECOND_MALE_IFORM_INANIMATE_PLURAL")
|
if (str == L"SECOND_MALE_SSFORM_INANIMATE")
|
||||||
{
|
{
|
||||||
return SECOND_MALE_IFORM_INANIMATE_PLURAL;
|
return SECOND_MALE_SSFORM_INANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"SECOND_MALE_IFORM_ANIMATE_SINGULAR")
|
if (str == L"SECOND_MALE_SSFORM_ANIMATE")
|
||||||
{
|
{
|
||||||
return SECOND_MALE_IFORM_ANIMATE_SINGULAR;
|
return SECOND_MALE_SSFORM_ANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"SECOND_MALE_IFORM_ANIMATE_PLURAL")
|
if (str == L"SECOND_NEUTRAL_E_FORM")
|
||||||
{
|
{
|
||||||
return SECOND_MALE_IFORM_ANIMATE_PLURAL;
|
return SECOND_NEUTRAL_E_FORM;
|
||||||
}
|
}
|
||||||
if (str == L"SECOND_MALE_UFORM_INANIMATE_SINGULAR")
|
if (str == L"SECOND_NEUTRAL_O_FORM")
|
||||||
{
|
{
|
||||||
return SECOND_MALE_UFORM_INANIMATE_SINGULAR;
|
return SECOND_NEUTRAL_O_FORM;
|
||||||
}
|
}
|
||||||
if (str == L"SECOND_MALE_UFORM_INANIMATE_PLURAL")
|
if (str == L"THIRD_FORM_INANIMATE")
|
||||||
{
|
{
|
||||||
return SECOND_MALE_UFORM_INANIMATE_PLURAL;
|
return THIRD_FORM_INANIMATE;
|
||||||
}
|
}
|
||||||
if (str == L"SECOND_MALE_UFORM_ANIMATE_SINGULAR")
|
if (str == L"THIRD_FORM_ANIMATE")
|
||||||
{
|
{
|
||||||
return SECOND_MALE_UFORM_ANIMATE_SINGULAR;
|
return THIRD_FORM_ANIMATE;
|
||||||
}
|
|
||||||
if (str == L"SECOND_MALE_UFORM_ANIMATE_PLURAL")
|
|
||||||
{
|
|
||||||
return SECOND_MALE_UFORM_ANIMATE_PLURAL;
|
|
||||||
}
|
|
||||||
if (str == L"SECOND_MALE_SSFORM_INANIMATE_SINGULAR")
|
|
||||||
{
|
|
||||||
return SECOND_MALE_SSFORM_INANIMATE_SINGULAR;
|
|
||||||
}
|
|
||||||
if (str == L"SECOND_MALE_SSFORM_INANIMATE_PLURAL")
|
|
||||||
{
|
|
||||||
return SECOND_MALE_SSFORM_INANIMATE_PLURAL;
|
|
||||||
}
|
|
||||||
if (str == L"SECOND_MALE_SSFORM_ANIMATE_SINGULAR")
|
|
||||||
{
|
|
||||||
return SECOND_MALE_SSFORM_ANIMATE_SINGULAR;
|
|
||||||
}
|
|
||||||
if (str == L"SECOND_MALE_SSFORM_ANIMATE_PLURAL")
|
|
||||||
{
|
|
||||||
return SECOND_MALE_SSFORM_ANIMATE_PLURAL;
|
|
||||||
}
|
|
||||||
if (str == L"SECOND_NEUTRAL_E_FORM_SINGULAR")
|
|
||||||
{
|
|
||||||
return SECOND_NEUTRAL_E_FORM_SINGULAR;
|
|
||||||
}
|
|
||||||
if (str == L"SECOND_NEUTRAL_E_FORM_PLURAL")
|
|
||||||
{
|
|
||||||
return SECOND_NEUTRAL_E_FORM_PLURAL;
|
|
||||||
}
|
|
||||||
if (str == L"SECOND_NEUTRAL_O_FORM_SINGULAR")
|
|
||||||
{
|
|
||||||
return SECOND_NEUTRAL_O_FORM_SINGULAR;
|
|
||||||
}
|
|
||||||
if (str == L"SECOND_NEUTRAL_O_FORM_PLURAL")
|
|
||||||
{
|
|
||||||
return SECOND_NEUTRAL_O_FORM_PLURAL;
|
|
||||||
}
|
|
||||||
if (str == L"THIRD_FORM_SINGULAR")
|
|
||||||
{
|
|
||||||
return THIRD_FORM_SINGULAR;
|
|
||||||
}
|
|
||||||
if (str == L"THIRD_FORM_INANIMATE_PLURAL")
|
|
||||||
{
|
|
||||||
return THIRD_FORM_INANIMATE_PLURAL;
|
|
||||||
}
|
|
||||||
if (str == L"THIRD_FORM_ANIMATE_PLURAL")
|
|
||||||
{
|
|
||||||
return THIRD_FORM_ANIMATE_PLURAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Error in WStringToNounDeclencion!" << std::endl;
|
std::cout << "Error in WStringToNounDeclencion!" << std::endl;
|
||||||
return FIRST_A_IFORM_SINGULAR;
|
return FIRST_A_IFORM_INANIMATE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NounCount WStringToNounCount(std::wstring str)
|
||||||
|
{
|
||||||
|
if (str == L"NC_SINGULAR")
|
||||||
|
{
|
||||||
|
return NC_SINGULAR;
|
||||||
|
}
|
||||||
|
if (str == L"NC_PLURAL")
|
||||||
|
{
|
||||||
|
return NC_PLURAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "Error in WStringToNounCount!" << std::endl;
|
||||||
|
return NC_SINGULAR;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::wstring NounCountToWString(NounCount nounCount)
|
||||||
|
{
|
||||||
|
if (nounCount == NC_SINGULAR)
|
||||||
|
{
|
||||||
|
return L"NC_SINGULAR";
|
||||||
|
}
|
||||||
|
if (nounCount == NC_PLURAL)
|
||||||
|
{
|
||||||
|
return L"NC_PLURAL";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "Error in NounCountToWString!" << std::endl;
|
||||||
|
return L"";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
std::wstring NounGrammaticalCaseToWString(NounGrammaticalCase nounGrammaticalCase)
|
std::wstring NounGrammaticalCaseToWString(NounGrammaticalCase nounGrammaticalCase)
|
||||||
{
|
{
|
||||||
@ -351,9 +339,9 @@ bool charIsVowel(wchar_t c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::set<std::pair<std::wstring, std::wstring>> getPossibleNounEndingDivisionSet(std::wstring noun)
|
std::set<NounEndingDivision> getPossibleNounEndingDivisionSet(std::wstring noun)
|
||||||
{
|
{
|
||||||
std::set<std::pair<std::wstring, std::wstring>> result;
|
std::set<NounEndingDivision> result;
|
||||||
|
|
||||||
auto allNounEndingArr = GetAllNounEndingArr();
|
auto allNounEndingArr = GetAllNounEndingArr();
|
||||||
|
|
||||||
@ -365,8 +353,20 @@ std::set<std::pair<std::wstring, std::wstring>> getPossibleNounEndingDivisionSet
|
|||||||
|
|
||||||
if (charIsConsolant(nounBase[nounBase.size() - 1]) || nounBase[nounBase.size() - 1] == L'ь' || nounBase[nounBase.size() - 1] == L'ъ')
|
if (charIsConsolant(nounBase[nounBase.size() - 1]) || nounBase[nounBase.size() - 1] == L'ь' || nounBase[nounBase.size() - 1] == L'ъ')
|
||||||
{
|
{
|
||||||
result.insert({ nounBase, ending});
|
result.insert({ nounBase, ending, NounEndingDivision::DC_COMMON });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Check missed vowel (simple case)
|
||||||
|
if (charIsConsolant(nounBase[nounBase.size() - 1]) && charIsConsolant(nounBase[nounBase.size() - 2]))
|
||||||
|
{
|
||||||
|
result.insert({ nounBase, ending, NounEndingDivision::DC_LOST_VOWEL_O });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (charIsConsolant(nounBase[nounBase.size() - 1]) && nounBase[nounBase.size() - 2] == L'ь')
|
||||||
|
{
|
||||||
|
result.insert({ nounBase, ending, NounEndingDivision::DC_LOST_VOWEL_E });
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,11 +381,11 @@ std::vector<NounTuple> GetPossibleNounTupleArr(std::wstring nounEnding)
|
|||||||
|
|
||||||
for (auto& noun : nounDeclencionCaseTable)
|
for (auto& noun : nounDeclencionCaseTable)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < NGC_SIZE * NC_SIZE; i++)
|
||||||
{
|
{
|
||||||
if (noun.grammaticalCaseMap[i].second == nounEnding)
|
if (noun.grammaticalCaseTable[i].ending == nounEnding)
|
||||||
{
|
{
|
||||||
result.push_back(NounTuple{ noun.nounDeclencion, noun.grammaticalCaseMap[i].first });
|
result.push_back(NounTuple{ noun.nounDeclencion, noun.grammaticalCaseTable[i].count, noun.grammaticalCaseTable[i].grammaticalCase });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,119 +394,6 @@ std::vector<NounTuple> GetPossibleNounTupleArr(std::wstring nounEnding)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NounDeclencionIsPlural(NounDeclencion nounDeclencion)
|
|
||||||
{
|
|
||||||
switch (nounDeclencion)
|
|
||||||
{
|
|
||||||
case FIRST_A_IFORM_SINGULAR:
|
|
||||||
case FIRST_A_UFORM_SINGULAR:
|
|
||||||
case FIRST_YA_FORM_SINGULAR:
|
|
||||||
case SECOND_MALE_IFORM_INANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_IFORM_ANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_UFORM_INANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_UFORM_ANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_SSFORM_INANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_SSFORM_ANIMATE_SINGULAR:
|
|
||||||
case SECOND_NEUTRAL_E_FORM_SINGULAR:
|
|
||||||
case SECOND_NEUTRAL_O_FORM_SINGULAR:
|
|
||||||
case THIRD_FORM_SINGULAR:
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NounDeclencion ConvertToSingularIfNeeded(NounDeclencion nounDeclencion)
|
|
||||||
{
|
|
||||||
switch (nounDeclencion)
|
|
||||||
{
|
|
||||||
case FIRST_A_IFORM_SINGULAR:
|
|
||||||
case FIRST_A_IFORM_INANIMATE_PLURAL:
|
|
||||||
case FIRST_A_IFORM_ANIMATE_PLURAL:
|
|
||||||
|
|
||||||
return FIRST_A_IFORM_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case FIRST_A_UFORM_SINGULAR:
|
|
||||||
case FIRST_A_UFORM_INANIMATE_PLURAL:
|
|
||||||
case FIRST_A_UFORM_ANIMATE_PLURAL:
|
|
||||||
|
|
||||||
return FIRST_A_UFORM_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case FIRST_YA_FORM_SINGULAR:
|
|
||||||
case FIRST_YA_FORM_INANIMATE_PLURAL:
|
|
||||||
case FIRST_YA_FORM_ANIMATE_PLURAL:
|
|
||||||
|
|
||||||
return FIRST_YA_FORM_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case SECOND_MALE_IFORM_INANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_IFORM_INANIMATE_PLURAL:
|
|
||||||
|
|
||||||
return SECOND_MALE_IFORM_INANIMATE_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case SECOND_MALE_IFORM_ANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_IFORM_ANIMATE_PLURAL:
|
|
||||||
|
|
||||||
return SECOND_MALE_IFORM_ANIMATE_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case SECOND_MALE_UFORM_INANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_UFORM_INANIMATE_PLURAL:
|
|
||||||
|
|
||||||
return SECOND_MALE_UFORM_INANIMATE_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case SECOND_MALE_UFORM_ANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_UFORM_ANIMATE_PLURAL:
|
|
||||||
|
|
||||||
return SECOND_MALE_UFORM_ANIMATE_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case SECOND_MALE_SSFORM_INANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_SSFORM_INANIMATE_PLURAL:
|
|
||||||
|
|
||||||
return SECOND_MALE_SSFORM_INANIMATE_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case SECOND_MALE_SSFORM_ANIMATE_SINGULAR:
|
|
||||||
case SECOND_MALE_SSFORM_ANIMATE_PLURAL:
|
|
||||||
|
|
||||||
return SECOND_MALE_SSFORM_ANIMATE_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case SECOND_NEUTRAL_E_FORM_SINGULAR:
|
|
||||||
case SECOND_NEUTRAL_E_FORM_PLURAL:
|
|
||||||
|
|
||||||
return SECOND_NEUTRAL_E_FORM_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case SECOND_NEUTRAL_O_FORM_SINGULAR:
|
|
||||||
case SECOND_NEUTRAL_O_FORM_PLURAL:
|
|
||||||
|
|
||||||
return SECOND_NEUTRAL_O_FORM_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case THIRD_FORM_SINGULAR:
|
|
||||||
case THIRD_FORM_INANIMATE_PLURAL:
|
|
||||||
case THIRD_FORM_ANIMATE_PLURAL:
|
|
||||||
|
|
||||||
return THIRD_FORM_SINGULAR;
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
|
|
||||||
std::cout << "Error in ConvertToSingularIfNeeded" << std::endl;
|
|
||||||
|
|
||||||
return FIRST_A_IFORM_SINGULAR;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<NounTuple> FilterNounTupleArrByNounDeclentionSet(std::vector<NounTuple> nounTupleArr, std::set<NounDeclencion> filter)
|
std::vector<NounTuple> FilterNounTupleArrByNounDeclentionSet(std::vector<NounTuple> nounTupleArr, std::set<NounDeclencion> filter)
|
||||||
{
|
{
|
||||||
std::vector<NounTuple> result;
|
std::vector<NounTuple> result;
|
||||||
@ -523,26 +410,26 @@ std::vector<NounTuple> FilterNounTupleArrByNounDeclentionSet(std::vector<NounTup
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::wstring GetNounNoninativeSingular(std::wstring nounBase, NounDeclencion nounDeclencion)
|
|
||||||
|
std::wstring GetNounNoninative(std::wstring nounBase, NounDeclencion nounDeclencion, NounCount nounCount)
|
||||||
{
|
{
|
||||||
NounDeclencion nounDeclencionSingular = ConvertToSingularIfNeeded(nounDeclencion);
|
NounDeclencionCaseTableRecord nounDeclencionCaseTableRecord = nounDeclencionCaseTable[static_cast<int>(nounDeclencion)];
|
||||||
|
|
||||||
//Get nominative form of this declention
|
for (auto& grammaticalTableRecord : nounDeclencionCaseTableRecord.grammaticalCaseTable)
|
||||||
std::wstring nounEndling = nounDeclencionCaseTable[static_cast<int>(nounDeclencionSingular)].grammaticalCaseMap[static_cast<int>(NGC_P1_NOMINATIVE)].second;
|
{
|
||||||
|
if (grammaticalTableRecord.grammaticalCase == NGC_P1_NOMINATIVE && grammaticalTableRecord.count == nounCount)
|
||||||
|
{
|
||||||
|
return nounBase + grammaticalTableRecord.ending;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nounBase + nounEndling;
|
std::cout << "Error in GetNounNoninative" << std::endl;
|
||||||
}
|
|
||||||
|
|
||||||
|
return L"";
|
||||||
std::wstring GetNounNoninative(std::wstring nounBase, NounDeclencion nounDeclencion)
|
|
||||||
{
|
|
||||||
std::wstring nounEndling = nounDeclencionCaseTable[static_cast<int>(nounDeclencion)].grammaticalCaseMap[static_cast<int>(NGC_P1_NOMINATIVE)].second;
|
|
||||||
|
|
||||||
return nounBase + nounEndling;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::wstring i_form_consolants = L"гкжшчщ";
|
std::wstring i_form_consolants = L"гкжшчщ";
|
||||||
std::wstring u_form_consolants = L"бпдтвфзснмлр";
|
std::wstring u_form_consolants = L"бпдтвфзснмлрц";
|
||||||
|
|
||||||
wchar_t GetLastChar(const NounRecord& nounRecord)
|
wchar_t GetLastChar(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
@ -565,51 +452,51 @@ bool charIsUFormConsolant(wchar_t c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FirstAIFormSingularCondition(const NounRecord& nounRecord)
|
bool FirstAIFormSingularCondition(const NounRecord& nounRecord) //Same for both animate and inanimate
|
||||||
{
|
{
|
||||||
return nounRecord.haveSingleForm && (GetLastChar(nounRecord) == L'а' && charIsIFormConsolant(GetPrevLastChar(nounRecord)));
|
return nounRecord.haveSingleForm && (GetLastChar(nounRecord) == L'а' && charIsIFormConsolant(GetPrevLastChar(nounRecord)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FirstAIFormInanimatePluralCondition(const NounRecord& nounRecord)
|
bool FirstAIFormInanimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.canBeInanimate && (GetLastChar(nounRecord) == L'а' && charIsIFormConsolant(GetPrevLastChar(nounRecord)));
|
return nounRecord.haveMultipleForm && nounRecord.canBeInanimate && (GetLastChar(nounRecord) == L'а' && charIsIFormConsolant(GetPrevLastChar(nounRecord)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FirstAIFormAnimatePluralCondition(const NounRecord& nounRecord)
|
bool FirstAIFormAnimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.canBeAnimate && (GetLastChar(nounRecord) == L'а' && charIsIFormConsolant(GetPrevLastChar(nounRecord)));
|
return nounRecord.haveMultipleForm && nounRecord.canBeAnimate && (GetLastChar(nounRecord) == L'а' && charIsIFormConsolant(GetPrevLastChar(nounRecord)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FirstAUFormSingularCondition(const NounRecord& nounRecord)
|
bool FirstAUFormSingularCondition(const NounRecord& nounRecord) //Same for both animate and inanimate
|
||||||
{
|
{
|
||||||
return nounRecord.haveSingleForm && (GetLastChar(nounRecord) == L'а' && charIsUFormConsolant(GetPrevLastChar(nounRecord)));
|
return nounRecord.haveSingleForm && (GetLastChar(nounRecord) == L'а' && charIsUFormConsolant(GetPrevLastChar(nounRecord)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FirstAUFormInanimatePluralCondition(const NounRecord& nounRecord)
|
bool FirstAUFormInanimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.canBeInanimate && (GetLastChar(nounRecord) == L'а' && charIsUFormConsolant(GetPrevLastChar(nounRecord)));
|
return nounRecord.haveMultipleForm && nounRecord.canBeInanimate && (GetLastChar(nounRecord) == L'а' && charIsUFormConsolant(GetPrevLastChar(nounRecord)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FirstAUFormAnimatePluralCondition(const NounRecord& nounRecord)
|
bool FirstAUFormAnimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.canBeAnimate && (GetLastChar(nounRecord) == L'а' && charIsUFormConsolant(GetPrevLastChar(nounRecord)));
|
return nounRecord.haveMultipleForm && nounRecord.canBeAnimate && (GetLastChar(nounRecord) == L'а' && charIsUFormConsolant(GetPrevLastChar(nounRecord)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FirstYaFormSingularCondition(const NounRecord& nounRecord)
|
bool FirstYaFormSingularCondition(const NounRecord& nounRecord) //Same for both animate and inanimate
|
||||||
{
|
{
|
||||||
return nounRecord.haveSingleForm && (GetLastChar(nounRecord) == L'я');
|
return nounRecord.haveSingleForm && (GetLastChar(nounRecord) == L'я');
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FirstYaFormInanimatePluralCondition(const NounRecord& nounRecord)
|
bool FirstYaFormInanimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.canBeInanimate && (GetLastChar(nounRecord) == L'я');
|
return nounRecord.haveMultipleForm && nounRecord.canBeInanimate && (GetLastChar(nounRecord) == L'я');
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FirstYaFormAnimatePluralCondition(const NounRecord& nounRecord)
|
bool FirstYaFormAnimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.canBeAnimate && (GetLastChar(nounRecord) == L'я');
|
return nounRecord.haveMultipleForm && nounRecord.canBeAnimate && (GetLastChar(nounRecord) == L'я');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -622,7 +509,7 @@ bool SecondMaleIFormInanimateSingularCondition(const NounRecord& nounRecord)
|
|||||||
|
|
||||||
bool SecondMaleIFormInanimatePluralCondition(const NounRecord& nounRecord)
|
bool SecondMaleIFormInanimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeInanimate && charIsIFormConsolant(GetLastChar(nounRecord));
|
return nounRecord.haveMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeInanimate && charIsIFormConsolant(GetLastChar(nounRecord));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -633,7 +520,7 @@ bool SecondMaleIFormAnimateSingularCondition(const NounRecord& nounRecord)
|
|||||||
|
|
||||||
bool SecondMaleIFormAnimatePluralCondition(const NounRecord& nounRecord)
|
bool SecondMaleIFormAnimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeAnimate && charIsIFormConsolant(GetLastChar(nounRecord));
|
return nounRecord.haveMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeAnimate && charIsIFormConsolant(GetLastChar(nounRecord));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -644,7 +531,7 @@ bool SecondMaleUFormInanimateSingularCondition(const NounRecord& nounRecord)
|
|||||||
|
|
||||||
bool SecondMaleUFormInanimatePluralCondition(const NounRecord& nounRecord)
|
bool SecondMaleUFormInanimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeInanimate && charIsUFormConsolant(GetLastChar(nounRecord));
|
return nounRecord.haveMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeInanimate && charIsUFormConsolant(GetLastChar(nounRecord));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -655,7 +542,7 @@ bool SecondMaleUFormAnimateSingularCondition(const NounRecord& nounRecord)
|
|||||||
|
|
||||||
bool SecondMaleUFormAnimatePluralCondition(const NounRecord& nounRecord)
|
bool SecondMaleUFormAnimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeAnimate && charIsUFormConsolant(GetLastChar(nounRecord));
|
return nounRecord.haveMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeAnimate && charIsUFormConsolant(GetLastChar(nounRecord));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -666,7 +553,7 @@ bool SecondMaleSSFormInanimateSingularCondition(const NounRecord& nounRecord)
|
|||||||
|
|
||||||
bool SecondMaleSSFormInanimatePluralCondition(const NounRecord& nounRecord)
|
bool SecondMaleSSFormInanimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeInanimate && GetLastChar(nounRecord) == L'ь';
|
return nounRecord.haveMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeInanimate && GetLastChar(nounRecord) == L'ь';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -677,7 +564,7 @@ bool SecondMaleSSFormAnimateSingularCondition(const NounRecord& nounRecord)
|
|||||||
|
|
||||||
bool SecondMaleSSFormAnimatePluralCondition(const NounRecord& nounRecord)
|
bool SecondMaleSSFormAnimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeAnimate && GetLastChar(nounRecord) == L'ь';
|
return nounRecord.haveMultipleForm && nounRecord.gender == NG_MALE && nounRecord.canBeAnimate && GetLastChar(nounRecord) == L'ь';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SecondNeutralEFormSingularCondition(const NounRecord& nounRecord)
|
bool SecondNeutralEFormSingularCondition(const NounRecord& nounRecord)
|
||||||
@ -687,7 +574,7 @@ bool SecondNeutralEFormSingularCondition(const NounRecord& nounRecord)
|
|||||||
|
|
||||||
bool SecondNeutralEFormPluralCondition(const NounRecord& nounRecord)
|
bool SecondNeutralEFormPluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.gender == NG_NEUTRAL && GetLastChar(nounRecord) == L'е';
|
return nounRecord.haveMultipleForm && nounRecord.gender == NG_NEUTRAL && GetLastChar(nounRecord) == L'е';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SecondNeutralOFormSingularCondition(const NounRecord& nounRecord)
|
bool SecondNeutralOFormSingularCondition(const NounRecord& nounRecord)
|
||||||
@ -697,67 +584,71 @@ bool SecondNeutralOFormSingularCondition(const NounRecord& nounRecord)
|
|||||||
|
|
||||||
bool SecondNeutralOFormPluralCondition(const NounRecord& nounRecord)
|
bool SecondNeutralOFormPluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.gender == NG_NEUTRAL && GetLastChar(nounRecord) == L'о';
|
return nounRecord.haveMultipleForm && nounRecord.gender == NG_NEUTRAL && GetLastChar(nounRecord) == L'о';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ThirdFormSingularCondition(const NounRecord& nounRecord)
|
bool ThirdFormSingularCondition(const NounRecord& nounRecord) //Same for both animate and inanimate
|
||||||
{
|
{
|
||||||
return nounRecord.haveSingleForm && nounRecord.gender == NG_FEMALE && GetLastChar(nounRecord) == L'ь';
|
return nounRecord.haveSingleForm && nounRecord.gender == NG_FEMALE && GetLastChar(nounRecord) == L'ь';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ThirdFormInanimatePluralCondition(const NounRecord& nounRecord)
|
bool ThirdFormInanimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.gender == NG_FEMALE && nounRecord.canBeInanimate && GetLastChar(nounRecord) == L'ь';
|
return nounRecord.haveMultipleForm && nounRecord.gender == NG_FEMALE && nounRecord.canBeInanimate && GetLastChar(nounRecord) == L'ь';
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ThirdFormAnimatePluralCondition(const NounRecord& nounRecord)
|
bool ThirdFormAnimatePluralCondition(const NounRecord& nounRecord)
|
||||||
{
|
{
|
||||||
return nounRecord.haveStandardMultipleForm && nounRecord.gender == NG_FEMALE && nounRecord.canBeAnimate && GetLastChar(nounRecord) == L'ь';
|
return nounRecord.haveMultipleForm && nounRecord.gender == NG_FEMALE && nounRecord.canBeAnimate && GetLastChar(nounRecord) == L'ь';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::map<NounDeclencion, std::function < bool(const NounRecord&) >> DeclentionConditionMap;
|
std::map<std::pair<NounDeclencion, NounCount>, std::function < bool(const NounRecord&) >> DeclentionConditionMap;
|
||||||
|
|
||||||
void SetupDeclentionMap()
|
void SetupDeclentionMap()
|
||||||
{
|
{
|
||||||
|
|
||||||
DeclentionConditionMap[FIRST_A_IFORM_SINGULAR] = std::bind(FirstAIFormSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{FIRST_A_IFORM_INANIMATE, NC_SINGULAR}] = std::bind(FirstAIFormSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[FIRST_A_IFORM_INANIMATE_PLURAL] = std::bind(FirstAIFormInanimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{FIRST_A_IFORM_ANIMATE, NC_SINGULAR}] = std::bind(FirstAIFormSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[FIRST_A_IFORM_ANIMATE_PLURAL] = std::bind(FirstAIFormAnimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{FIRST_A_IFORM_INANIMATE, NC_PLURAL}] = std::bind(FirstAIFormInanimatePluralCondition, std::placeholders::_1);
|
||||||
|
DeclentionConditionMap[{FIRST_A_IFORM_ANIMATE, NC_PLURAL}] = std::bind(FirstAIFormAnimatePluralCondition, std::placeholders::_1);
|
||||||
|
|
||||||
DeclentionConditionMap[FIRST_A_UFORM_SINGULAR] = std::bind(FirstAUFormSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{FIRST_A_UFORM_INANIMATE, NC_SINGULAR}] = std::bind(FirstAUFormSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[FIRST_A_UFORM_INANIMATE_PLURAL] = std::bind(FirstAUFormInanimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{FIRST_A_UFORM_ANIMATE, NC_SINGULAR}] = std::bind(FirstAUFormSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[FIRST_A_UFORM_ANIMATE_PLURAL] = std::bind(FirstAUFormAnimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{FIRST_A_UFORM_INANIMATE, NC_PLURAL}] = std::bind(FirstAUFormInanimatePluralCondition, std::placeholders::_1);
|
||||||
|
DeclentionConditionMap[{FIRST_A_UFORM_ANIMATE, NC_PLURAL}] = std::bind(FirstAUFormAnimatePluralCondition, std::placeholders::_1);
|
||||||
|
|
||||||
DeclentionConditionMap[FIRST_YA_FORM_SINGULAR] = std::bind(FirstYaFormSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{FIRST_YA_FORM_INANIMATE, NC_SINGULAR}] = std::bind(FirstYaFormSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[FIRST_YA_FORM_INANIMATE_PLURAL] = std::bind(FirstYaFormInanimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{FIRST_YA_FORM_ANIMATE, NC_SINGULAR}] = std::bind(FirstYaFormSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[FIRST_YA_FORM_ANIMATE_PLURAL] = std::bind(FirstYaFormAnimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{FIRST_YA_FORM_INANIMATE, NC_PLURAL}] = std::bind(FirstYaFormInanimatePluralCondition, std::placeholders::_1);
|
||||||
|
DeclentionConditionMap[{FIRST_YA_FORM_ANIMATE, NC_PLURAL}] = std::bind(FirstYaFormAnimatePluralCondition, std::placeholders::_1);
|
||||||
|
|
||||||
//Second form
|
//Second form
|
||||||
DeclentionConditionMap[SECOND_MALE_IFORM_INANIMATE_SINGULAR] = std::bind(SecondMaleIFormInanimateSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_IFORM_INANIMATE, NC_SINGULAR}] = std::bind(SecondMaleIFormInanimateSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_MALE_IFORM_INANIMATE_PLURAL] = std::bind(SecondMaleIFormInanimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_IFORM_INANIMATE, NC_PLURAL}] = std::bind(SecondMaleIFormInanimatePluralCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_MALE_IFORM_ANIMATE_SINGULAR] = std::bind(SecondMaleIFormAnimateSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_IFORM_ANIMATE, NC_SINGULAR}] = std::bind(SecondMaleIFormAnimateSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_MALE_IFORM_ANIMATE_PLURAL] = std::bind(SecondMaleIFormAnimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_IFORM_ANIMATE, NC_PLURAL}] = std::bind(SecondMaleIFormAnimatePluralCondition, std::placeholders::_1);
|
||||||
|
|
||||||
DeclentionConditionMap[SECOND_MALE_UFORM_INANIMATE_SINGULAR] = std::bind(SecondMaleUFormInanimateSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_UFORM_INANIMATE, NC_SINGULAR}] = std::bind(SecondMaleUFormInanimateSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_MALE_UFORM_INANIMATE_PLURAL] = std::bind(SecondMaleUFormInanimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_UFORM_INANIMATE, NC_PLURAL}] = std::bind(SecondMaleUFormInanimatePluralCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_MALE_UFORM_ANIMATE_SINGULAR] = std::bind(SecondMaleUFormAnimateSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_UFORM_ANIMATE, NC_SINGULAR}] = std::bind(SecondMaleUFormAnimateSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_MALE_UFORM_ANIMATE_PLURAL] = std::bind(SecondMaleUFormAnimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_UFORM_ANIMATE, NC_PLURAL}] = std::bind(SecondMaleUFormAnimatePluralCondition, std::placeholders::_1);
|
||||||
|
|
||||||
DeclentionConditionMap[SECOND_MALE_SSFORM_INANIMATE_SINGULAR] = std::bind(SecondMaleSSFormInanimateSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_SSFORM_INANIMATE, NC_SINGULAR}] = std::bind(SecondMaleSSFormInanimateSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_MALE_SSFORM_INANIMATE_PLURAL] = std::bind(SecondMaleSSFormInanimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_SSFORM_INANIMATE, NC_PLURAL}] = std::bind(SecondMaleSSFormInanimatePluralCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_MALE_SSFORM_ANIMATE_SINGULAR] = std::bind(SecondMaleSSFormAnimateSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_SSFORM_ANIMATE, NC_SINGULAR}] = std::bind(SecondMaleSSFormAnimateSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_MALE_SSFORM_ANIMATE_PLURAL] = std::bind(SecondMaleSSFormAnimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_MALE_SSFORM_ANIMATE, NC_PLURAL}] = std::bind(SecondMaleSSFormAnimatePluralCondition, std::placeholders::_1);
|
||||||
|
|
||||||
DeclentionConditionMap[SECOND_NEUTRAL_E_FORM_SINGULAR] = std::bind(SecondNeutralEFormSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_NEUTRAL_E_FORM, NC_SINGULAR}] = std::bind(SecondNeutralEFormSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_NEUTRAL_E_FORM_PLURAL] = std::bind(SecondNeutralEFormPluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_NEUTRAL_E_FORM, NC_PLURAL}] = std::bind(SecondNeutralEFormPluralCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_NEUTRAL_O_FORM_SINGULAR] = std::bind(SecondNeutralOFormSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_NEUTRAL_O_FORM, NC_SINGULAR}] = std::bind(SecondNeutralOFormSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[SECOND_NEUTRAL_O_FORM_PLURAL] = std::bind(SecondNeutralOFormPluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{SECOND_NEUTRAL_O_FORM, NC_PLURAL}] = std::bind(SecondNeutralOFormPluralCondition, std::placeholders::_1);
|
||||||
|
|
||||||
|
|
||||||
DeclentionConditionMap[THIRD_FORM_SINGULAR] = std::bind(ThirdFormSingularCondition, std::placeholders::_1);
|
DeclentionConditionMap[{THIRD_FORM_INANIMATE, NC_SINGULAR}] = std::bind(ThirdFormSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[THIRD_FORM_INANIMATE_PLURAL] = std::bind(ThirdFormInanimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{THIRD_FORM_ANIMATE, NC_SINGULAR}] = std::bind(ThirdFormSingularCondition, std::placeholders::_1);
|
||||||
DeclentionConditionMap[THIRD_FORM_ANIMATE_PLURAL] = std::bind(ThirdFormAnimatePluralCondition, std::placeholders::_1);
|
DeclentionConditionMap[{THIRD_FORM_INANIMATE, NC_PLURAL}] = std::bind(ThirdFormInanimatePluralCondition, std::placeholders::_1);
|
||||||
|
DeclentionConditionMap[{THIRD_FORM_ANIMATE, NC_PLURAL}] = std::bind(ThirdFormAnimatePluralCondition, std::placeholders::_1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -767,8 +658,16 @@ bool NounFitsDeclention(NounRecord nounRecord, NounTuple nounTuple)
|
|||||||
{
|
{
|
||||||
|
|
||||||
NounDeclencion nounDeclencion = std::get<0>(nounTuple);
|
NounDeclencion nounDeclencion = std::get<0>(nounTuple);
|
||||||
|
NounCount nounCount = std::get<1>(nounTuple);
|
||||||
|
|
||||||
return DeclentionConditionMap[nounDeclencion](nounRecord);
|
bool standardDeclention = DeclentionConditionMap[{nounDeclencion, nounCount}](nounRecord);
|
||||||
|
|
||||||
|
if (standardDeclention)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NounScructIsAlreadyInArray(const NounStruct& nounStruct, const std::vector<NounStruct>& arr)
|
bool NounScructIsAlreadyInArray(const NounStruct& nounStruct, const std::vector<NounStruct>& arr)
|
||||||
@ -784,6 +683,59 @@ bool NounScructIsAlreadyInArray(const NounStruct& nounStruct, const std::vector<
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
bool IsDeclencionSecondType(NounDeclencion nounDeclention)
|
||||||
|
{
|
||||||
|
switch (nounDeclention)
|
||||||
|
{
|
||||||
|
case SECOND_MALE_IFORM_INANIMATE:
|
||||||
|
case SECOND_MALE_IFORM_ANIMATE:
|
||||||
|
case SECOND_MALE_UFORM_INANIMATE:
|
||||||
|
case SECOND_MALE_UFORM_ANIMATE:
|
||||||
|
case SECOND_MALE_SSFORM_INANIMATE:
|
||||||
|
case SECOND_MALE_SSFORM_ANIMATE:
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsDeclencionAnimated(NounDeclencion nounDeclention)
|
||||||
|
{
|
||||||
|
switch (nounDeclention)
|
||||||
|
{
|
||||||
|
case FIRST_A_IFORM_ANIMATE:
|
||||||
|
case FIRST_A_UFORM_ANIMATE:
|
||||||
|
case FIRST_YA_FORM_ANIMATE:
|
||||||
|
case SECOND_MALE_IFORM_ANIMATE:
|
||||||
|
case SECOND_MALE_UFORM_ANIMATE:
|
||||||
|
case SECOND_MALE_SSFORM_ANIMATE:
|
||||||
|
case THIRD_FORM_ANIMATE:
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool StandardTest(NounTuple nounTuple, NounRecord nounRecord)
|
||||||
|
{
|
||||||
|
return NounFitsDeclention(nounRecord, nounTuple);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LostVowelOTest(NounTuple nounTuple, NounRecord nounRecord)
|
||||||
|
{
|
||||||
|
return nounRecord.haveStandardMultipleFormWithMissingLastVowel;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LostVowelETest(NounTuple nounTuple, NounRecord nounRecord)
|
||||||
|
{
|
||||||
|
return nounRecord.haveStandardMultipleFormWithMissingLastVowel;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<NounStruct> RecognizeNoun(std::wstring noun)
|
std::vector<NounStruct> RecognizeNoun(std::wstring noun)
|
||||||
{
|
{
|
||||||
@ -794,27 +746,91 @@ std::vector<NounStruct> RecognizeNoun(std::wstring noun)
|
|||||||
|
|
||||||
for (auto nounEndingDivision : nounEndingDivisionArr)
|
for (auto nounEndingDivision : nounEndingDivisionArr)
|
||||||
{
|
{
|
||||||
std::wstring nounBase = nounEndingDivision.first;
|
std::wstring nounBase = nounEndingDivision.base;
|
||||||
std::wstring nounEnding = nounEndingDivision.second;
|
std::wstring nounEnding = nounEndingDivision.ending;
|
||||||
|
NounEndingDivision::DivisionCase dc = nounEndingDivision.divisionCase;
|
||||||
|
|
||||||
|
|
||||||
|
if (dc == NounEndingDivision::DC_LOST_VOWEL_O)
|
||||||
|
{
|
||||||
|
nounBase.insert(nounBase.begin() + nounBase.size() - 1, L'о');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dc == NounEndingDivision::DC_LOST_VOWEL_E)
|
||||||
|
{
|
||||||
|
nounBase[nounBase.size() - 2] = L'е';
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<NounTuple> possibleTupleArr = GetPossibleNounTupleArr(nounEnding);
|
std::vector<NounTuple> possibleTupleArr = GetPossibleNounTupleArr(nounEnding);
|
||||||
|
|
||||||
//std::vector<NounTuple> sureTupleArr;
|
|
||||||
|
|
||||||
//Standard check
|
//Standard check
|
||||||
for (auto nounTuple : possibleTupleArr)
|
for (NounTuple nounTuple : possibleTupleArr)
|
||||||
{
|
{
|
||||||
std::wstring nounNominaviteSingular = GetNounNoninativeSingular(nounBase, std::get<0>(nounTuple));
|
bool animated = IsDeclencionAnimated(std::get<0>(nounTuple));
|
||||||
|
|
||||||
|
bool additionalTest = true;
|
||||||
|
|
||||||
|
if (dc == NounEndingDivision::DC_LOST_VOWEL_O)
|
||||||
|
{
|
||||||
|
additionalTest = (std::get<1>(nounTuple) == NC_PLURAL) ||
|
||||||
|
((std::get<0>(nounTuple) != NGC_P1_NOMINATIVE) &&
|
||||||
|
(!(std::get<0>(nounTuple) == NGC_P4_ACCUSATIVE && !animated)));
|
||||||
|
}
|
||||||
|
if (dc == NounEndingDivision::DC_LOST_VOWEL_E)
|
||||||
|
{
|
||||||
|
additionalTest = (std::get<1>(nounTuple) == NC_PLURAL) ||
|
||||||
|
((std::get<0>(nounTuple) != NGC_P1_NOMINATIVE) &&
|
||||||
|
(!(std::get<0>(nounTuple) == NGC_P4_ACCUSATIVE && !animated)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!additionalTest)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::wstring nounNominaviteSingular = GetNounNoninative(nounBase, std::get<0>(nounTuple), NC_SINGULAR);
|
||||||
|
|
||||||
if (NounIsInDictionary(nounNominaviteSingular))
|
if (NounIsInDictionary(nounNominaviteSingular))
|
||||||
{
|
{
|
||||||
|
|
||||||
NounRecord nounRecord = GetNounRecordFromDictionary(nounNominaviteSingular);
|
NounRecord nounRecord = GetNounRecordFromDictionary(nounNominaviteSingular);
|
||||||
|
|
||||||
if (NounFitsDeclention(nounRecord, nounTuple))
|
bool secondAdditionalTest = true;
|
||||||
|
|
||||||
|
if (dc == NounEndingDivision::DC_LOST_VOWEL_O)
|
||||||
{
|
{
|
||||||
//sureTupleArr.push_back(nounTuple);
|
secondAdditionalTest = LostVowelOTest(nounTuple, nounRecord) && StandardTest(nounTuple, nounRecord);
|
||||||
result.push_back({ std::get<1>(nounTuple), nounRecord });
|
}
|
||||||
|
else if (dc == NounEndingDivision::DC_LOST_VOWEL_E)
|
||||||
|
{
|
||||||
|
secondAdditionalTest = LostVowelETest(nounTuple, nounRecord) && StandardTest(nounTuple, nounRecord);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
secondAdditionalTest = (nounRecord.haveStandardMultipleForm || std::get<1>(nounTuple) == NC_SINGULAR) && StandardTest(nounTuple, nounRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (secondAdditionalTest)
|
||||||
|
{
|
||||||
|
|
||||||
|
result.push_back({ std::get<2>(nounTuple), std::get<1>(nounTuple), animated, nounRecord });
|
||||||
|
|
||||||
|
//Check for additional form
|
||||||
|
if (IsDeclencionSecondType(std::get<0>(nounTuple)))
|
||||||
|
{
|
||||||
|
if (std::get<1>(nounTuple) == NC_SINGULAR && nounRecord.haveAlternativeMultipleFormEnding)
|
||||||
|
{
|
||||||
|
//Add additional form!
|
||||||
|
result.push_back({ NGC_P1_NOMINATIVE, NC_PLURAL, animated, nounRecord });
|
||||||
|
|
||||||
|
if (nounRecord.canBeInanimate)
|
||||||
|
{
|
||||||
|
result.push_back({ NGC_P4_ACCUSATIVE, NC_PLURAL, animated, nounRecord });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -822,19 +838,33 @@ std::vector<NounStruct> RecognizeNoun(std::wstring noun)
|
|||||||
//Special plural form check
|
//Special plural form check
|
||||||
for (auto nounTuple : possibleTupleArr)
|
for (auto nounTuple : possibleTupleArr)
|
||||||
{
|
{
|
||||||
if (NounDeclencionIsPlural(std::get<0>(nounTuple)))
|
if (std::get<1>(nounTuple) == NC_PLURAL)
|
||||||
{
|
{
|
||||||
std::wstring nounNominavitePlural = GetNounNoninative(nounBase, std::get<0>(nounTuple));
|
std::wstring nounNominavitePlural = GetNounNoninative(nounBase, std::get<0>(nounTuple), NC_PLURAL);
|
||||||
|
|
||||||
if (NounSpecialPluralFormIsInDictionary(nounNominavitePlural))
|
if (NounSpecialPluralFormIsInDictionary(nounNominavitePlural))
|
||||||
{
|
{
|
||||||
NounRecord nounRecord = GetNounRecordFromDictionary_BySpecialPluralForm(nounNominavitePlural);
|
NounRecord nounRecord = GetNounRecordFromDictionary_BySpecialPluralForm(nounNominavitePlural);
|
||||||
|
|
||||||
NounStruct ns{ std::get<1>(nounTuple), nounRecord };
|
|
||||||
|
|
||||||
if (!NounScructIsAlreadyInArray(ns, result))
|
if (nounRecord.canBeAnimate)
|
||||||
{
|
{
|
||||||
result.push_back(ns);
|
NounStruct ns{ std::get<2>(nounTuple), std::get<1>(nounTuple), true, nounRecord };
|
||||||
|
|
||||||
|
if (!NounScructIsAlreadyInArray(ns, result))
|
||||||
|
{
|
||||||
|
result.push_back(ns);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nounRecord.canBeInanimate)
|
||||||
|
{
|
||||||
|
NounStruct ns{ std::get<2>(nounTuple), std::get<1>(nounTuple), false, nounRecord };
|
||||||
|
|
||||||
|
if (!NounScructIsAlreadyInArray(ns, result))
|
||||||
|
{
|
||||||
|
result.push_back(ns);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -859,7 +889,7 @@ NounDeclencion CalculateNounDeclention(NounRecord nounRecord)
|
|||||||
{
|
{
|
||||||
if (i.second(nounRecord))
|
if (i.second(nounRecord))
|
||||||
{
|
{
|
||||||
return i.first;
|
return i.first.first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -889,9 +919,11 @@ void LoadNounDeclencionCaseTable()
|
|||||||
|
|
||||||
std::cout << "File found!" << std::endl;
|
std::cout << "File found!" << std::endl;
|
||||||
|
|
||||||
std::vector<std::pair<NounGrammaticalCase, std::wstring>> currentGrammaticalCaseMap;
|
std::vector<GrammaticalTableRecord> currentGrammaticalCaseTable;
|
||||||
std::wstring currentNounDeclencion;
|
std::wstring currentNounDeclencion;
|
||||||
|
std::wstring currentNounCount;
|
||||||
|
|
||||||
|
getline(f, line); //Skip one line
|
||||||
|
|
||||||
while (getline(f, line))
|
while (getline(f, line))
|
||||||
{
|
{
|
||||||
@ -907,22 +939,31 @@ void LoadNounDeclencionCaseTable()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nounDeclencionCaseTable.push_back(NounDeclencionCaseTableRecord{ WStringToNounDeclencion(currentNounDeclencion), currentGrammaticalCaseMap });
|
nounDeclencionCaseTable.push_back(NounDeclencionCaseTableRecord{ WStringToNounDeclencion(currentNounDeclencion), currentGrammaticalCaseTable });
|
||||||
|
|
||||||
currentNounDeclencion = string_to_wstring(lineArr[0]);
|
currentNounDeclencion = string_to_wstring(lineArr[0]);
|
||||||
|
|
||||||
currentGrammaticalCaseMap.clear();
|
currentGrammaticalCaseTable.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
currentGrammaticalCaseMap.push_back({ WStringToNounGrammaticalCase(string_to_wstring(lineArr[1])), string_to_wstring(lineArr[2]) });
|
if (lineArr[1] != "")
|
||||||
|
{
|
||||||
|
currentNounCount = string_to_wstring(lineArr[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
currentGrammaticalCaseTable.push_back({
|
||||||
|
WStringToNounCount(currentNounCount),
|
||||||
|
WStringToNounGrammaticalCase(string_to_wstring(lineArr[2])),
|
||||||
|
string_to_wstring(lineArr[3])
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
//Add last one
|
//Add last one
|
||||||
if (currentNounDeclencion != L"")
|
if (currentNounDeclencion != L"")
|
||||||
{
|
{
|
||||||
nounDeclencionCaseTable.push_back(NounDeclencionCaseTableRecord{ WStringToNounDeclencion(currentNounDeclencion), currentGrammaticalCaseMap });
|
nounDeclencionCaseTable.push_back(NounDeclencionCaseTableRecord{ WStringToNounDeclencion(currentNounDeclencion), currentGrammaticalCaseTable });
|
||||||
}
|
}
|
||||||
|
|
||||||
f.close();
|
f.close();
|
||||||
@ -951,6 +992,9 @@ void LoadFrequentWordSet()
|
|||||||
|
|
||||||
if (f.is_open())
|
if (f.is_open())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
getline(f, line); //Skip one line
|
||||||
|
|
||||||
std::cout << "File found!" << std::endl;
|
std::cout << "File found!" << std::endl;
|
||||||
while (getline(f, line))
|
while (getline(f, line))
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,9 @@ struct NounRecord
|
|||||||
bool haveStandardMultipleForm;
|
bool haveStandardMultipleForm;
|
||||||
bool haveStandardMultipleFormWithMissingLastVowel;
|
bool haveStandardMultipleFormWithMissingLastVowel;
|
||||||
|
|
||||||
|
bool haveStandardMultipleFormEnding;
|
||||||
|
bool haveAlternativeMultipleFormEnding;
|
||||||
|
|
||||||
std::wstring specialMultipleForm;
|
std::wstring specialMultipleForm;
|
||||||
|
|
||||||
bool canBeAnimate;
|
bool canBeAnimate;
|
||||||
@ -38,34 +41,22 @@ struct NounRecord
|
|||||||
|
|
||||||
enum NounDeclencion
|
enum NounDeclencion
|
||||||
{
|
{
|
||||||
FIRST_A_IFORM_SINGULAR = 0,
|
FIRST_A_IFORM_INANIMATE = 0,
|
||||||
FIRST_A_IFORM_INANIMATE_PLURAL,
|
FIRST_A_IFORM_ANIMATE,
|
||||||
FIRST_A_IFORM_ANIMATE_PLURAL,
|
FIRST_A_UFORM_INANIMATE,
|
||||||
FIRST_A_UFORM_SINGULAR,
|
FIRST_A_UFORM_ANIMATE,
|
||||||
FIRST_A_UFORM_INANIMATE_PLURAL,
|
FIRST_YA_FORM_INANIMATE,
|
||||||
FIRST_A_UFORM_ANIMATE_PLURAL,
|
FIRST_YA_FORM_ANIMATE,
|
||||||
FIRST_YA_FORM_SINGULAR,
|
SECOND_MALE_IFORM_INANIMATE,
|
||||||
FIRST_YA_FORM_INANIMATE_PLURAL,
|
SECOND_MALE_IFORM_ANIMATE,
|
||||||
FIRST_YA_FORM_ANIMATE_PLURAL,
|
SECOND_MALE_UFORM_INANIMATE,
|
||||||
SECOND_MALE_IFORM_INANIMATE_SINGULAR,
|
SECOND_MALE_UFORM_ANIMATE,
|
||||||
SECOND_MALE_IFORM_INANIMATE_PLURAL,
|
SECOND_MALE_SSFORM_INANIMATE,
|
||||||
SECOND_MALE_IFORM_ANIMATE_SINGULAR,
|
SECOND_MALE_SSFORM_ANIMATE,
|
||||||
SECOND_MALE_IFORM_ANIMATE_PLURAL,
|
SECOND_NEUTRAL_E_FORM,
|
||||||
SECOND_MALE_UFORM_INANIMATE_SINGULAR,
|
SECOND_NEUTRAL_O_FORM,
|
||||||
SECOND_MALE_UFORM_INANIMATE_PLURAL,
|
THIRD_FORM_INANIMATE,
|
||||||
SECOND_MALE_UFORM_ANIMATE_SINGULAR,
|
THIRD_FORM_ANIMATE,
|
||||||
SECOND_MALE_UFORM_ANIMATE_PLURAL,
|
|
||||||
SECOND_MALE_SSFORM_INANIMATE_SINGULAR,
|
|
||||||
SECOND_MALE_SSFORM_INANIMATE_PLURAL,
|
|
||||||
SECOND_MALE_SSFORM_ANIMATE_SINGULAR,
|
|
||||||
SECOND_MALE_SSFORM_ANIMATE_PLURAL,
|
|
||||||
SECOND_NEUTRAL_E_FORM_SINGULAR,
|
|
||||||
SECOND_NEUTRAL_E_FORM_PLURAL,
|
|
||||||
SECOND_NEUTRAL_O_FORM_SINGULAR,
|
|
||||||
SECOND_NEUTRAL_O_FORM_PLURAL,
|
|
||||||
THIRD_FORM_SINGULAR,
|
|
||||||
THIRD_FORM_INANIMATE_PLURAL,
|
|
||||||
THIRD_FORM_ANIMATE_PLURAL
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum NounGrammaticalCase
|
enum NounGrammaticalCase
|
||||||
@ -75,31 +66,88 @@ enum NounGrammaticalCase
|
|||||||
NGC_P3_DATIVE,
|
NGC_P3_DATIVE,
|
||||||
NGC_P4_ACCUSATIVE,
|
NGC_P4_ACCUSATIVE,
|
||||||
NGC_P5_INSTRUMENTAL,
|
NGC_P5_INSTRUMENTAL,
|
||||||
NGC_P6_PREPOSITIONAL
|
NGC_P6_PREPOSITIONAL,
|
||||||
|
NGC_SIZE
|
||||||
|
};
|
||||||
|
|
||||||
|
enum NounCount
|
||||||
|
{
|
||||||
|
NC_SINGULAR = 0,
|
||||||
|
NC_PLURAL,
|
||||||
|
NC_SIZE
|
||||||
|
};
|
||||||
|
|
||||||
|
struct GrammaticalTableRecord
|
||||||
|
{
|
||||||
|
NounCount count;
|
||||||
|
|
||||||
|
NounGrammaticalCase grammaticalCase;
|
||||||
|
|
||||||
|
std::wstring ending;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NounDeclencionCaseTableRecord
|
struct NounDeclencionCaseTableRecord
|
||||||
{
|
{
|
||||||
NounDeclencion nounDeclencion;
|
NounDeclencion nounDeclencion;
|
||||||
std::vector<std::pair<NounGrammaticalCase, std::wstring>> grammaticalCaseMap;
|
std::vector<GrammaticalTableRecord> grammaticalCaseTable;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern std::vector<NounRecord> NounRecordArr;
|
extern std::vector<NounRecord> NounRecordArr;
|
||||||
|
|
||||||
extern std::vector<NounDeclencionCaseTableRecord> nounDeclencionCaseTable;
|
extern std::vector<NounDeclencionCaseTableRecord> nounDeclencionCaseTable;
|
||||||
|
|
||||||
|
|
||||||
NounDeclencion WStringToNounDeclencion(std::wstring str);
|
NounDeclencion WStringToNounDeclencion(std::wstring str);
|
||||||
|
std::wstring NounCountToWString(NounCount nounCount);
|
||||||
|
NounCount WStringToNounCount(std::wstring str);
|
||||||
std::wstring NounGrammaticalCaseToWString(NounGrammaticalCase nounGrammaticalCase);
|
std::wstring NounGrammaticalCaseToWString(NounGrammaticalCase nounGrammaticalCase);
|
||||||
NounGrammaticalCase WStringToNounGrammaticalCase(std::wstring str);
|
NounGrammaticalCase WStringToNounGrammaticalCase(std::wstring str);
|
||||||
|
|
||||||
|
|
||||||
//std::wstring NounNumberToWString(NounNumber nounNumber);
|
//std::wstring NounNumberToWString(NounNumber nounNumber);
|
||||||
|
|
||||||
typedef std::tuple<NounDeclencion, NounGrammaticalCase> NounTuple;
|
typedef std::tuple<
|
||||||
|
NounDeclencion,
|
||||||
|
NounCount,
|
||||||
|
NounGrammaticalCase
|
||||||
|
> NounTuple;
|
||||||
|
|
||||||
typedef std::set<std::wstring> StringSet;
|
typedef std::set<std::wstring> StringSet;
|
||||||
|
|
||||||
|
struct NounEndingDivision
|
||||||
|
{
|
||||||
|
std::wstring base;
|
||||||
|
std::wstring ending;
|
||||||
|
|
||||||
|
enum DivisionCase
|
||||||
|
{
|
||||||
|
DC_COMMON = 0,
|
||||||
|
DC_LOST_VOWEL_O,
|
||||||
|
DC_LOST_VOWEL_E,
|
||||||
|
} divisionCase;
|
||||||
|
|
||||||
|
bool operator<(const NounEndingDivision& other) const
|
||||||
|
{
|
||||||
|
if (base != other.base)
|
||||||
|
{
|
||||||
|
return base < other.base;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (ending != other.ending)
|
||||||
|
{
|
||||||
|
return ending < other.ending;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return divisionCase < other.divisionCase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
std::vector<std::wstring> GetAllNounEndingArr();
|
std::vector<std::wstring> GetAllNounEndingArr();
|
||||||
|
|
||||||
bool NounIsInDictionary(std::wstring nounNominative);
|
bool NounIsInDictionary(std::wstring nounNominative);
|
||||||
@ -117,28 +165,26 @@ bool charIsVowel(wchar_t c);
|
|||||||
struct NounStruct
|
struct NounStruct
|
||||||
{
|
{
|
||||||
NounGrammaticalCase nounGrammaticalCase;
|
NounGrammaticalCase nounGrammaticalCase;
|
||||||
|
NounCount nounCount;
|
||||||
|
bool animated;
|
||||||
NounRecord nounRecord;
|
NounRecord nounRecord;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
std::set<std::pair<std::wstring, std::wstring>> getPossibleNounEndingDivisionSet(std::wstring noun);
|
std::set<NounEndingDivision> getPossibleNounEndingDivisionSet(std::wstring noun);
|
||||||
|
|
||||||
std::vector<NounTuple> GetPossibleNounTupleArr(std::wstring nounEnding);
|
std::vector<NounTuple> GetPossibleNounTupleArr(std::wstring nounEnding);
|
||||||
|
|
||||||
bool NounDeclencionIsPlural(NounDeclencion nounDeclencion);
|
std::wstring GetNounNoninative(std::wstring nounBase, NounDeclencion nounDeclencion, NounCount nounCount);
|
||||||
|
|
||||||
NounDeclencion ConvertToSingularIfNeeded(NounDeclencion nounDeclencion);
|
|
||||||
|
|
||||||
std::wstring GetNounNoninativeSingular(std::wstring nounBase, NounDeclencion nounDeclencion);
|
|
||||||
|
|
||||||
std::wstring GetNounNoninativePlural(std::wstring nounBase, NounDeclencion nounDeclencion);
|
|
||||||
|
|
||||||
std::wstring GetNounNoninative(std::wstring nounBase, NounDeclencion nounDeclencion);
|
|
||||||
|
|
||||||
void SetupDeclentionMap();
|
void SetupDeclentionMap();
|
||||||
|
|
||||||
bool NounFitsDeclention(NounRecord nounRecord, NounTuple nounTuple);
|
bool NounFitsDeclention(NounRecord nounRecord, NounTuple nounTuple);
|
||||||
|
|
||||||
|
bool IsDeclencionSecondType(NounDeclencion nounDeclention);
|
||||||
|
bool IsDeclencionAnimated(NounDeclencion nounDeclention);
|
||||||
|
|
||||||
|
|
||||||
std::vector<NounStruct> RecognizeNoun(std::wstring noun);
|
std::vector<NounStruct> RecognizeNoun(std::wstring noun);
|
||||||
|
|
||||||
NounDeclencion CalculateNounDeclention(NounRecord nounRecord);
|
NounDeclencion CalculateNounDeclention(NounRecord nounRecord);
|
||||||
|
Loading…
Reference in New Issue
Block a user