-
Notifications
You must be signed in to change notification settings - Fork 0
/
format.cc
176 lines (169 loc) · 4.22 KB
/
format.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// Copyright (C) 2011 Petr Machata
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public
// License along with this program. If not, see
// <http://www.gnu.org/licenses/>.
#include <boost/format.hpp>
#include "rus_gramtab.hh"
char const *
format_rus (pos_code_t val)
{
switch (val)
{
case pos_noun:
return "noun";
case pos_adjective:
return "adjective";
case pos_verb:
return "verb";
case pos_adverb:
return "adverb";
case pos_interjection:
return "interjection";
case pos_transition_word:
return "transition_word";
case pos_particle:
return "particle";
case pos_conjunction:
return "conjunction";
case pos_pronoun:
return "pronoun";
case pos_negative_pronoun:
return "negative_pronoun";
case pos_short_adjective:
return "short_adjective";
case pos_infinitive:
return "infinitive";
case pos_adv_participle:
return "adv_participle";
case pos_adj_participle:
return "adj_participle";
case pos_pronominal_adjective:
return "pronominal_adjective";
case pos_number:
return "number";
case pos_ordinal_number:
return "ordinal_number";
case pos_preposition:
return "preposition";
case pos_predicative:
return "predicative";
case pos_short_participle:
return "short_participle";
case pos_11:
case pos_15:
case pos__invalid:
break;
};
throw std::runtime_error
(str (boost::format ("Cannot determine how to call part of speech %d.")
% val));
}
char const *
format_rus (gram_code_t val)
{
switch (val)
{
case gm_plural:
return "plural";
case gm_singular:
return "singular";
case gm_nominative:
return "nominative";
case gm_genitive:
return "genitive";
case gm_dative:
return "dative";
case gm_accusative:
return "accusative";
case gm_instrumental:
return "instrumental";
case gm_prepositional:
return "prepositional";
case gm_vocative:
return "vocative";
case gm_masculine:
return "masculine";
case gm_feminine:
return "feminine";
case gm_neuter:
return "neuter";
case gm_masc_femin:
return "masculine/feminine";
case gm_present:
return "present";
case gm_future:
return "future";
case gm_past:
return "past";
case gm_1st_person:
return "1st_person";
case gm_2nd_person:
return "2nd_person";
case gm_3rd_person:
return "3rd_person";
case gm_imperative:
return "imperative";
case gm_animate:
return "animate";
case gm_inanimate:
return "inanimate";
case gm_comparative:
return "comparative";
case gm_perfective:
return "perfective";
case gm_imperfective:
return "imperfective";
case gm_active:
return "active";
case gm_passive:
return "passive";
case gm_superlative:
return "superlative";
case gm_positive:
return "positive";
case gm_secondary:
return "secondary";
case gm_colloquial:
return "colloquial";
case gm_indeclinable:
return "indeclinable";
case gm_first_name:
return "first_name";
case gm_patronymic:
return "patronymic";
case gm_surname:
return "surname";
case gm_25:
case gm_26:
case gm_abbr:
case gm_32:
case gm_33:
case gm_34:
case gm_35:
case gm_36:
case gm_37:
case gm_impersonal:
case gm_jargon:
case gm_42:
case gm_44:
case gm_45:
case gm_poetic:
case gm_prof:
case gm__invalid:
break;
};
throw std::runtime_error
(str (boost::format ("Cannot determine how to call grammeme value %d.")
% val));
}