Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef LGK_H__
- #define LGK_H__
- /********* Parts of speech codes *************************/
- namespace mt
- {
- /**
- * all possible speech parts
- */
- enum spart_type
- {
- /* without options */
- special_part = -1,
- abbreviation = 1, /**< сокращение */
- adverb, /**< наречие */
- interjection, /**< междометие */
- conjunction, /**< союз */
- article, /**< артикль */
- numeral, /**< количественное числительное */
- ord_numeral, /**< порядковое числительное */
- preposition, /**< предлог */
- form, /**< неизменяемое */
- particle, /**< частица */
- predicative, /**< предикатив */
- /* with options */
- pronoun = 1<<4, /**< личное местоимение */
- adjective = 1<<5, /**< прилагательное */
- noun = 1<<6, /**< существительное */
- verb = 1<<7, /**< глагол */
- /**< extra options in high bit*/
- euphemism = 1<<10 /**< эвфемизм */
- };
- namespace adj_bits
- {
- enum options
- { /**< параметры прилагательного */
- sya = 1, /**< употребляется с 'ся' */
- pronoun = 1<<1, /**< местоимённое прилагательное */
- /* bit not used */
- comparative = 1<<3, /**< наличие сравнительной формы */
- has_short = 1<<4 /**< наличие короткой формы */
- };
- }
- namespace noun_bits
- {
- enum options
- { /**< параметры существительного*/
- singular = 1, /**< только единственное число */
- plural = 1<<1, /**< только множественное число */
- normal = singular|plural, /**< обычное (и едиственное и множественное число) */
- animated = 1<<2, /**< одушевлённое */
- masculine = 1<<3, /**< мужской род*/
- feminine = 1<<4, /**< женский род */
- old_neuter = feminine|masculine, /**< средний род */
- unchangeable = 1<<5, /**< неизменяемое */
- /* верхние биты */
- pronoun = 1<<8, /**< ещё отдельное свойство под причастие */
- neuter = 1<<9 /**< ещё один отдельный бит для среднего рода */
- };
- }
- namespace verb_bits
- {
- enum options
- { /**< параметры глагола */
- sya = 1, /**< глагол с 'ся' */
- participle3 = 1<<1, /**< причастие 3, 'делаемый' */
- participle4 = 1<<2, /**< причастие 4, 'деланный' */
- perfect = 1<<3, /**< совершенный */
- imperfect = 1<<4, /**< несовершенный */
- transitive = 1<<5, /**< переходный */
- intransitive = 1<<6, /**< непереходный */
- /* верхние биты */
- geborren = 1<<8, /**< некоторое исключение в немецком языке */
- prich = 1<<9 /**< причастие (форма глагола, меняется как прилагательное) */ //P_PRICH
- };
- }
- int speech_part(int); /**< @return only speech part bit from code */
- inline bool is_noun(int lgk) { return (speech_part(lgk)&mt::noun) == mt::noun; }
- inline bool is_verb(int lgk) { return (speech_part(lgk)&mt::verb) == mt::verb; }
- inline bool is_adjective(int lgk){ return (speech_part(lgk)&mt::adjective) == mt::adjective; }
- inline bool is_prich(int lgk)
- {
- return (!is_noun(lgk)) &&
- ((lgk&mt::verb_bits::prich) == mt::verb_bits::prich);
- }
- bool is_perfect(int); /**< @check are lgk perfect */
- }
- //что это?
- #define N_NOMINATIVE_PLURAL 128
- #define N_ACCUSATIVE_PLURAL 1024
- #define N_ACCUSATIVE_PLURAL1 2048
- #define N_ACCUSATIVE_SINGULAR 8
- #define N_ACCUSATIVE_SINGULAR1 16
- #define N_ACCUSATIVES N_ACCUSATIVE_SINGULAR|N_ACCUSATIVE_SINGULAR1|N_ACCUSATIVE_PLURAL|N_ACCUSATIVE_PLURAL1
- //This is separate type of the form
- //Уточнить что это такое
- // New forms bits
- #define F_NOMINATIVE ((DWORDLONG)1 << 0)
- #define F_GENITIVE ((DWORDLONG)1 << 1)
- #define F_DATIVE ((DWORDLONG)1 << 2)
- #define F_ACCUSATIVE ((DWORDLONG)1 << 3)
- #define F_INSTRUMENTAL ((DWORDLONG)1 << 4)
- #define F_PREPOSITIONAL ((DWORDLONG)1 << 5)
- #define F_MASCULINE ((DWORDLONG)1 << 6)
- #define F_FEMININE ((DWORDLONG)1 << 7)
- #define F_NEUTER ((DWORDLONG)1 << 8)
- #define F_SINGULAR ((DWORDLONG)1 << 9)
- #define F_PLURAL ((DWORDLONG)1 << 10)
- #define F_SHORT ((DWORDLONG)1 << 11)
- #define F_COMPARATIVE ((DWORDLONG)1 << 12)
- #define F_COMPARATIVE1 ((DWORDLONG)1 << 13) // for English - big-bigger-biggest
- #define F_LITSO1 ((DWORDLONG)1 << 14)
- #define F_LITSO2 ((DWORDLONG)1 << 15)
- #define F_LITSO3 ((DWORDLONG)1 << 16)
- #define F_DEEPR ((DWORDLONG)1 << 17)
- #define F_INFINITIVE ((DWORDLONG)1 << 18)
- #define F_IMPERATIVE ((DWORDLONG)1 << 19)
- #define F_PAST ((DWORDLONG)1 << 20)
- #define F_PRESENT ((DWORDLONG)1 << 21)
- #define F_FUTURE ((DWORDLONG)1 << 22)
- #define F_ANIMATED ((DWORDLONG)1 << 23)
- #define F_INANIMATED ((DWORDLONG)1 << 24)
- #define F_PRICH ((DWORDLONG)1 << 25)
- #define F_NOUN ((DWORDLONG)1 << 26)
- #define F_VERB ((DWORDLONG)1 << 27)
- #define F_ADJECTIVE ((DWORDLONG)1 << 28)
- #define F_ADVERB ((DWORDLONG)1 << 29)
- #define F_GERUND ((DWORDLONG)1 << 30)
- #define F_INDEFINITE ((DWORDLONG)1 << 31)
- #define F_SYA ((DWORDLONG)1 << 32)
- #define F_PRICH1 ((DWORDLONG)1 << 33)
- #define F_PRICH2 ((DWORDLONG)1 << 34)
- #define F_PRICH3 ((DWORDLONG)1 << 35)
- #define F_PRICH4 ((DWORDLONG)1 << 36)
- #define F_ADDITIONAL_FORM ((DWORDLONG)1 << 37)
- #define F_PARTICIPLE ((DWORDLONG)1 << 38)
- #define F_PREPOSITION ((DWORDLONG)1 << 39)
- #define F_SPEECH_PART_MASK F_NOUN|F_VERB|F_ADJECTIVE|F_ADVERB
- #define F_CASEMASK (F_NOMINATIVE | F_GENITIVE | F_DATIVE | F_ACCUSATIVE | F_INSTRUMENTAL | F_PREPOSITIONAL)
- #define F_GENDERMASK (F_MASCULINE | F_FEMININE | F_NEUTER)
- #define F_NUMBERMASK (F_SINGULAR | F_PLURAL)
- #define F_SHORTMASK (F_SHORT)
- #define F_COMPARATIVEMASK (F_COMPARATIVE)
- #define F_LITSOMASK (F_LITSO1 | F_LITSO2 | F_LITSO3)
- #define F_DEEPRMASK (F_DEEPRMASK)
- #define F_INFINITIVEMASK (F_INFINITIVE)
- #define F_TENSEMASK (F_PAST | F_PRESENT | F_FUTURE)
- #define F_ANIMATEDMASK (F_ANIMATED | F_INANIMATED)
- #endif
Advertisement
Add Comment
Please, Sign In to add comment