00001
00002
00003 #include <limits.h>
00004 #include "russian.h"
00005
00006 static const symbol s_0_0[10] = { 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8, 0xD1, 0x81, 0xD1, 0x8C };
00007 static const symbol s_0_1[12] = { 0xD1, 0x8B, 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8, 0xD1, 0x81, 0xD1, 0x8C };
00008 static const symbol s_0_2[12] = { 0xD0, 0xB8, 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8, 0xD1, 0x81, 0xD1, 0x8C };
00009 static const symbol s_0_3[2] = { 0xD0, 0xB2 };
00010 static const symbol s_0_4[4] = { 0xD1, 0x8B, 0xD0, 0xB2 };
00011 static const symbol s_0_5[4] = { 0xD0, 0xB8, 0xD0, 0xB2 };
00012 static const symbol s_0_6[6] = { 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8 };
00013 static const symbol s_0_7[8] = { 0xD1, 0x8B, 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8 };
00014 static const symbol s_0_8[8] = { 0xD0, 0xB8, 0xD0, 0xB2, 0xD1, 0x88, 0xD0, 0xB8 };
00015
00016 static const struct among a_0[9] =
00017 {
00018 { 10, s_0_0, -1, 1},
00019 { 12, s_0_1, 0, 2},
00020 { 12, s_0_2, 0, 2},
00021 { 2, s_0_3, -1, 1},
00022 { 4, s_0_4, 3, 2},
00023 { 4, s_0_5, 3, 2},
00024 { 6, s_0_6, -1, 1},
00025 { 8, s_0_7, 6, 2},
00026 { 8, s_0_8, 6, 2}
00027 };
00028
00029 static const symbol s_1_0[6] = { 0xD0, 0xB5, 0xD0, 0xBC, 0xD1, 0x83 };
00030 static const symbol s_1_1[6] = { 0xD0, 0xBE, 0xD0, 0xBC, 0xD1, 0x83 };
00031 static const symbol s_1_2[4] = { 0xD1, 0x8B, 0xD1, 0x85 };
00032 static const symbol s_1_3[4] = { 0xD0, 0xB8, 0xD1, 0x85 };
00033 static const symbol s_1_4[4] = { 0xD1, 0x83, 0xD1, 0x8E };
00034 static const symbol s_1_5[4] = { 0xD1, 0x8E, 0xD1, 0x8E };
00035 static const symbol s_1_6[4] = { 0xD0, 0xB5, 0xD1, 0x8E };
00036 static const symbol s_1_7[4] = { 0xD0, 0xBE, 0xD1, 0x8E };
00037 static const symbol s_1_8[4] = { 0xD1, 0x8F, 0xD1, 0x8F };
00038 static const symbol s_1_9[4] = { 0xD0, 0xB0, 0xD1, 0x8F };
00039 static const symbol s_1_10[4] = { 0xD1, 0x8B, 0xD0, 0xB5 };
00040 static const symbol s_1_11[4] = { 0xD0, 0xB5, 0xD0, 0xB5 };
00041 static const symbol s_1_12[4] = { 0xD0, 0xB8, 0xD0, 0xB5 };
00042 static const symbol s_1_13[4] = { 0xD0, 0xBE, 0xD0, 0xB5 };
00043 static const symbol s_1_14[6] = { 0xD1, 0x8B, 0xD0, 0xBC, 0xD0, 0xB8 };
00044 static const symbol s_1_15[6] = { 0xD0, 0xB8, 0xD0, 0xBC, 0xD0, 0xB8 };
00045 static const symbol s_1_16[4] = { 0xD1, 0x8B, 0xD0, 0xB9 };
00046 static const symbol s_1_17[4] = { 0xD0, 0xB5, 0xD0, 0xB9 };
00047 static const symbol s_1_18[4] = { 0xD0, 0xB8, 0xD0, 0xB9 };
00048 static const symbol s_1_19[4] = { 0xD0, 0xBE, 0xD0, 0xB9 };
00049 static const symbol s_1_20[4] = { 0xD1, 0x8B, 0xD0, 0xBC };
00050 static const symbol s_1_21[4] = { 0xD0, 0xB5, 0xD0, 0xBC };
00051 static const symbol s_1_22[4] = { 0xD0, 0xB8, 0xD0, 0xBC };
00052 static const symbol s_1_23[4] = { 0xD0, 0xBE, 0xD0, 0xBC };
00053 static const symbol s_1_24[6] = { 0xD0, 0xB5, 0xD0, 0xB3, 0xD0, 0xBE };
00054 static const symbol s_1_25[6] = { 0xD0, 0xBE, 0xD0, 0xB3, 0xD0, 0xBE };
00055
00056 static const struct among a_1[26] =
00057 {
00058 { 6, s_1_0, -1, 1},
00059 { 6, s_1_1, -1, 1},
00060 { 4, s_1_2, -1, 1},
00061 { 4, s_1_3, -1, 1},
00062 { 4, s_1_4, -1, 1},
00063 { 4, s_1_5, -1, 1},
00064 { 4, s_1_6, -1, 1},
00065 { 4, s_1_7, -1, 1},
00066 { 4, s_1_8, -1, 1},
00067 { 4, s_1_9, -1, 1},
00068 { 4, s_1_10, -1, 1},
00069 { 4, s_1_11, -1, 1},
00070 { 4, s_1_12, -1, 1},
00071 { 4, s_1_13, -1, 1},
00072 { 6, s_1_14, -1, 1},
00073 { 6, s_1_15, -1, 1},
00074 { 4, s_1_16, -1, 1},
00075 { 4, s_1_17, -1, 1},
00076 { 4, s_1_18, -1, 1},
00077 { 4, s_1_19, -1, 1},
00078 { 4, s_1_20, -1, 1},
00079 { 4, s_1_21, -1, 1},
00080 { 4, s_1_22, -1, 1},
00081 { 4, s_1_23, -1, 1},
00082 { 6, s_1_24, -1, 1},
00083 { 6, s_1_25, -1, 1}
00084 };
00085
00086 static const symbol s_2_0[4] = { 0xD0, 0xB2, 0xD1, 0x88 };
00087 static const symbol s_2_1[6] = { 0xD1, 0x8B, 0xD0, 0xB2, 0xD1, 0x88 };
00088 static const symbol s_2_2[6] = { 0xD0, 0xB8, 0xD0, 0xB2, 0xD1, 0x88 };
00089 static const symbol s_2_3[2] = { 0xD1, 0x89 };
00090 static const symbol s_2_4[4] = { 0xD1, 0x8E, 0xD1, 0x89 };
00091 static const symbol s_2_5[6] = { 0xD1, 0x83, 0xD1, 0x8E, 0xD1, 0x89 };
00092 static const symbol s_2_6[4] = { 0xD0, 0xB5, 0xD0, 0xBC };
00093 static const symbol s_2_7[4] = { 0xD0, 0xBD, 0xD0, 0xBD };
00094
00095 static const struct among a_2[8] =
00096 {
00097 { 4, s_2_0, -1, 1},
00098 { 6, s_2_1, 0, 2},
00099 { 6, s_2_2, 0, 2},
00100 { 2, s_2_3, -1, 1},
00101 { 4, s_2_4, 3, 1},
00102 { 6, s_2_5, 4, 2},
00103 { 4, s_2_6, -1, 1},
00104 { 4, s_2_7, -1, 1}
00105 };
00106
00107 static const symbol s_3_0[4] = { 0xD1, 0x81, 0xD1, 0x8C };
00108 static const symbol s_3_1[4] = { 0xD1, 0x81, 0xD1, 0x8F };
00109
00110 static const struct among a_3[2] =
00111 {
00112 { 4, s_3_0, -1, 1},
00113 { 4, s_3_1, -1, 1}
00114 };
00115
00116 static const symbol s_4_0[4] = { 0xD1, 0x8B, 0xD1, 0x82 };
00117 static const symbol s_4_1[4] = { 0xD1, 0x8E, 0xD1, 0x82 };
00118 static const symbol s_4_2[6] = { 0xD1, 0x83, 0xD1, 0x8E, 0xD1, 0x82 };
00119 static const symbol s_4_3[4] = { 0xD1, 0x8F, 0xD1, 0x82 };
00120 static const symbol s_4_4[4] = { 0xD0, 0xB5, 0xD1, 0x82 };
00121 static const symbol s_4_5[6] = { 0xD1, 0x83, 0xD0, 0xB5, 0xD1, 0x82 };
00122 static const symbol s_4_6[4] = { 0xD0, 0xB8, 0xD1, 0x82 };
00123 static const symbol s_4_7[4] = { 0xD0, 0xBD, 0xD1, 0x8B };
00124 static const symbol s_4_8[6] = { 0xD0, 0xB5, 0xD0, 0xBD, 0xD1, 0x8B };
00125 static const symbol s_4_9[4] = { 0xD1, 0x82, 0xD1, 0x8C };
00126 static const symbol s_4_10[6] = { 0xD1, 0x8B, 0xD1, 0x82, 0xD1, 0x8C };
00127 static const symbol s_4_11[6] = { 0xD0, 0xB8, 0xD1, 0x82, 0xD1, 0x8C };
00128 static const symbol s_4_12[6] = { 0xD0, 0xB5, 0xD1, 0x88, 0xD1, 0x8C };
00129 static const symbol s_4_13[6] = { 0xD0, 0xB8, 0xD1, 0x88, 0xD1, 0x8C };
00130 static const symbol s_4_14[2] = { 0xD1, 0x8E };
00131 static const symbol s_4_15[4] = { 0xD1, 0x83, 0xD1, 0x8E };
00132 static const symbol s_4_16[4] = { 0xD0, 0xBB, 0xD0, 0xB0 };
00133 static const symbol s_4_17[6] = { 0xD1, 0x8B, 0xD0, 0xBB, 0xD0, 0xB0 };
00134 static const symbol s_4_18[6] = { 0xD0, 0xB8, 0xD0, 0xBB, 0xD0, 0xB0 };
00135 static const symbol s_4_19[4] = { 0xD0, 0xBD, 0xD0, 0xB0 };
00136 static const symbol s_4_20[6] = { 0xD0, 0xB5, 0xD0, 0xBD, 0xD0, 0xB0 };
00137 static const symbol s_4_21[6] = { 0xD0, 0xB5, 0xD1, 0x82, 0xD0, 0xB5 };
00138 static const symbol s_4_22[6] = { 0xD0, 0xB8, 0xD1, 0x82, 0xD0, 0xB5 };
00139 static const symbol s_4_23[6] = { 0xD0, 0xB9, 0xD1, 0x82, 0xD0, 0xB5 };
00140 static const symbol s_4_24[8] = { 0xD1, 0x83, 0xD0, 0xB9, 0xD1, 0x82, 0xD0, 0xB5 };
00141 static const symbol s_4_25[8] = { 0xD0, 0xB5, 0xD0, 0xB9, 0xD1, 0x82, 0xD0, 0xB5 };
00142 static const symbol s_4_26[4] = { 0xD0, 0xBB, 0xD0, 0xB8 };
00143 static const symbol s_4_27[6] = { 0xD1, 0x8B, 0xD0, 0xBB, 0xD0, 0xB8 };
00144 static const symbol s_4_28[6] = { 0xD0, 0xB8, 0xD0, 0xBB, 0xD0, 0xB8 };
00145 static const symbol s_4_29[2] = { 0xD0, 0xB9 };
00146 static const symbol s_4_30[4] = { 0xD1, 0x83, 0xD0, 0xB9 };
00147 static const symbol s_4_31[4] = { 0xD0, 0xB5, 0xD0, 0xB9 };
00148 static const symbol s_4_32[2] = { 0xD0, 0xBB };
00149 static const symbol s_4_33[4] = { 0xD1, 0x8B, 0xD0, 0xBB };
00150 static const symbol s_4_34[4] = { 0xD0, 0xB8, 0xD0, 0xBB };
00151 static const symbol s_4_35[4] = { 0xD1, 0x8B, 0xD0, 0xBC };
00152 static const symbol s_4_36[4] = { 0xD0, 0xB5, 0xD0, 0xBC };
00153 static const symbol s_4_37[4] = { 0xD0, 0xB8, 0xD0, 0xBC };
00154 static const symbol s_4_38[2] = { 0xD0, 0xBD };
00155 static const symbol s_4_39[4] = { 0xD0, 0xB5, 0xD0, 0xBD };
00156 static const symbol s_4_40[4] = { 0xD0, 0xBB, 0xD0, 0xBE };
00157 static const symbol s_4_41[6] = { 0xD1, 0x8B, 0xD0, 0xBB, 0xD0, 0xBE };
00158 static const symbol s_4_42[6] = { 0xD0, 0xB8, 0xD0, 0xBB, 0xD0, 0xBE };
00159 static const symbol s_4_43[4] = { 0xD0, 0xBD, 0xD0, 0xBE };
00160 static const symbol s_4_44[6] = { 0xD0, 0xB5, 0xD0, 0xBD, 0xD0, 0xBE };
00161 static const symbol s_4_45[6] = { 0xD0, 0xBD, 0xD0, 0xBD, 0xD0, 0xBE };
00162
00163 static const struct among a_4[46] =
00164 {
00165 { 4, s_4_0, -1, 2},
00166 { 4, s_4_1, -1, 1},
00167 { 6, s_4_2, 1, 2},
00168 { 4, s_4_3, -1, 2},
00169 { 4, s_4_4, -1, 1},
00170 { 6, s_4_5, 4, 2},
00171 { 4, s_4_6, -1, 2},
00172 { 4, s_4_7, -1, 1},
00173 { 6, s_4_8, 7, 2},
00174 { 4, s_4_9, -1, 1},
00175 { 6, s_4_10, 9, 2},
00176 { 6, s_4_11, 9, 2},
00177 { 6, s_4_12, -1, 1},
00178 { 6, s_4_13, -1, 2},
00179 { 2, s_4_14, -1, 2},
00180 { 4, s_4_15, 14, 2},
00181 { 4, s_4_16, -1, 1},
00182 { 6, s_4_17, 16, 2},
00183 { 6, s_4_18, 16, 2},
00184 { 4, s_4_19, -1, 1},
00185 { 6, s_4_20, 19, 2},
00186 { 6, s_4_21, -1, 1},
00187 { 6, s_4_22, -1, 2},
00188 { 6, s_4_23, -1, 1},
00189 { 8, s_4_24, 23, 2},
00190 { 8, s_4_25, 23, 2},
00191 { 4, s_4_26, -1, 1},
00192 { 6, s_4_27, 26, 2},
00193 { 6, s_4_28, 26, 2},
00194 { 2, s_4_29, -1, 1},
00195 { 4, s_4_30, 29, 2},
00196 { 4, s_4_31, 29, 2},
00197 { 2, s_4_32, -1, 1},
00198 { 4, s_4_33, 32, 2},
00199 { 4, s_4_34, 32, 2},
00200 { 4, s_4_35, -1, 2},
00201 { 4, s_4_36, -1, 1},
00202 { 4, s_4_37, -1, 2},
00203 { 2, s_4_38, -1, 1},
00204 { 4, s_4_39, 38, 2},
00205 { 4, s_4_40, -1, 1},
00206 { 6, s_4_41, 40, 2},
00207 { 6, s_4_42, 40, 2},
00208 { 4, s_4_43, -1, 1},
00209 { 6, s_4_44, 43, 2},
00210 { 6, s_4_45, 43, 1}
00211 };
00212
00213 static const symbol s_5_0[2] = { 0xD1, 0x83 };
00214 static const symbol s_5_1[4] = { 0xD1, 0x8F, 0xD1, 0x85 };
00215 static const symbol s_5_2[6] = { 0xD0, 0xB8, 0xD1, 0x8F, 0xD1, 0x85 };
00216 static const symbol s_5_3[4] = { 0xD0, 0xB0, 0xD1, 0x85 };
00217 static const symbol s_5_4[2] = { 0xD1, 0x8B };
00218 static const symbol s_5_5[2] = { 0xD1, 0x8C };
00219 static const symbol s_5_6[2] = { 0xD1, 0x8E };
00220 static const symbol s_5_7[4] = { 0xD1, 0x8C, 0xD1, 0x8E };
00221 static const symbol s_5_8[4] = { 0xD0, 0xB8, 0xD1, 0x8E };
00222 static const symbol s_5_9[2] = { 0xD1, 0x8F };
00223 static const symbol s_5_10[4] = { 0xD1, 0x8C, 0xD1, 0x8F };
00224 static const symbol s_5_11[4] = { 0xD0, 0xB8, 0xD1, 0x8F };
00225 static const symbol s_5_12[2] = { 0xD0, 0xB0 };
00226 static const symbol s_5_13[4] = { 0xD0, 0xB5, 0xD0, 0xB2 };
00227 static const symbol s_5_14[4] = { 0xD0, 0xBE, 0xD0, 0xB2 };
00228 static const symbol s_5_15[2] = { 0xD0, 0xB5 };
00229 static const symbol s_5_16[4] = { 0xD1, 0x8C, 0xD0, 0xB5 };
00230 static const symbol s_5_17[4] = { 0xD0, 0xB8, 0xD0, 0xB5 };
00231 static const symbol s_5_18[2] = { 0xD0, 0xB8 };
00232 static const symbol s_5_19[4] = { 0xD0, 0xB5, 0xD0, 0xB8 };
00233 static const symbol s_5_20[4] = { 0xD0, 0xB8, 0xD0, 0xB8 };
00234 static const symbol s_5_21[6] = { 0xD1, 0x8F, 0xD0, 0xBC, 0xD0, 0xB8 };
00235 static const symbol s_5_22[8] = { 0xD0, 0xB8, 0xD1, 0x8F, 0xD0, 0xBC, 0xD0, 0xB8 };
00236 static const symbol s_5_23[6] = { 0xD0, 0xB0, 0xD0, 0xBC, 0xD0, 0xB8 };
00237 static const symbol s_5_24[2] = { 0xD0, 0xB9 };
00238 static const symbol s_5_25[4] = { 0xD0, 0xB5, 0xD0, 0xB9 };
00239 static const symbol s_5_26[6] = { 0xD0, 0xB8, 0xD0, 0xB5, 0xD0, 0xB9 };
00240 static const symbol s_5_27[4] = { 0xD0, 0xB8, 0xD0, 0xB9 };
00241 static const symbol s_5_28[4] = { 0xD0, 0xBE, 0xD0, 0xB9 };
00242 static const symbol s_5_29[4] = { 0xD1, 0x8F, 0xD0, 0xBC };
00243 static const symbol s_5_30[6] = { 0xD0, 0xB8, 0xD1, 0x8F, 0xD0, 0xBC };
00244 static const symbol s_5_31[4] = { 0xD0, 0xB0, 0xD0, 0xBC };
00245 static const symbol s_5_32[4] = { 0xD0, 0xB5, 0xD0, 0xBC };
00246 static const symbol s_5_33[6] = { 0xD0, 0xB8, 0xD0, 0xB5, 0xD0, 0xBC };
00247 static const symbol s_5_34[4] = { 0xD0, 0xBE, 0xD0, 0xBC };
00248 static const symbol s_5_35[2] = { 0xD0, 0xBE };
00249
00250 static const struct among a_5[36] =
00251 {
00252 { 2, s_5_0, -1, 1},
00253 { 4, s_5_1, -1, 1},
00254 { 6, s_5_2, 1, 1},
00255 { 4, s_5_3, -1, 1},
00256 { 2, s_5_4, -1, 1},
00257 { 2, s_5_5, -1, 1},
00258 { 2, s_5_6, -1, 1},
00259 { 4, s_5_7, 6, 1},
00260 { 4, s_5_8, 6, 1},
00261 { 2, s_5_9, -1, 1},
00262 { 4, s_5_10, 9, 1},
00263 { 4, s_5_11, 9, 1},
00264 { 2, s_5_12, -1, 1},
00265 { 4, s_5_13, -1, 1},
00266 { 4, s_5_14, -1, 1},
00267 { 2, s_5_15, -1, 1},
00268 { 4, s_5_16, 15, 1},
00269 { 4, s_5_17, 15, 1},
00270 { 2, s_5_18, -1, 1},
00271 { 4, s_5_19, 18, 1},
00272 { 4, s_5_20, 18, 1},
00273 { 6, s_5_21, 18, 1},
00274 { 8, s_5_22, 21, 1},
00275 { 6, s_5_23, 18, 1},
00276 { 2, s_5_24, -1, 1},
00277 { 4, s_5_25, 24, 1},
00278 { 6, s_5_26, 25, 1},
00279 { 4, s_5_27, 24, 1},
00280 { 4, s_5_28, 24, 1},
00281 { 4, s_5_29, -1, 1},
00282 { 6, s_5_30, 29, 1},
00283 { 4, s_5_31, -1, 1},
00284 { 4, s_5_32, -1, 1},
00285 { 6, s_5_33, 32, 1},
00286 { 4, s_5_34, -1, 1},
00287 { 2, s_5_35, -1, 1}
00288 };
00289
00290 static const symbol s_6_0[6] = { 0xD0, 0xBE, 0xD1, 0x81, 0xD1, 0x82 };
00291 static const symbol s_6_1[8] = { 0xD0, 0xBE, 0xD1, 0x81, 0xD1, 0x82, 0xD1, 0x8C };
00292
00293 static const struct among a_6[2] =
00294 {
00295 { 6, s_6_0, -1, 1},
00296 { 8, s_6_1, -1, 1}
00297 };
00298
00299 static const symbol s_7_0[6] = { 0xD0, 0xB5, 0xD0, 0xB9, 0xD1, 0x88 };
00300 static const symbol s_7_1[2] = { 0xD1, 0x8C };
00301 static const symbol s_7_2[8] = { 0xD0, 0xB5, 0xD0, 0xB9, 0xD1, 0x88, 0xD0, 0xB5 };
00302 static const symbol s_7_3[2] = { 0xD0, 0xBD };
00303
00304 static const struct among a_7[4] =
00305 {
00306 { 6, s_7_0, -1, 1},
00307 { 2, s_7_1, -1, 3},
00308 { 8, s_7_2, -1, 1},
00309 { 2, s_7_3, -1, 2}
00310 };
00311
00312 static const unsigned char g_v[] = { 33, 65, 8, 232 };
00313
00314 static const symbol s_0[] = { 0xD0, 0xB0 };
00315 static const symbol s_1[] = { 0xD1, 0x8F };
00316 static const symbol s_2[] = { 0xD0, 0xB0 };
00317 static const symbol s_3[] = { 0xD1, 0x8F };
00318 static const symbol s_4[] = { 0xD0, 0xB0 };
00319 static const symbol s_5[] = { 0xD1, 0x8F };
00320 static const symbol s_6[] = { 0xD0, 0xBD };
00321 static const symbol s_7[] = { 0xD0, 0xBD };
00322 static const symbol s_8[] = { 0xD0, 0xBD };
00323 static const symbol s_9[] = { 0xD0, 0xB8 };
00324
00325 int Xapian::InternalStemRussian::r_mark_regions() {
00326 I_pV = l;
00327 I_p2 = l;
00328 { int c1 = c;
00329 { int ret = out_grouping_U(g_v, 1072, 1103, 1);
00330 if (ret < 0) goto lab0;
00331 c += ret;
00332 }
00333 I_pV = c;
00334 { int ret = in_grouping_U(g_v, 1072, 1103, 1);
00335 if (ret < 0) goto lab0;
00336 c += ret;
00337 }
00338 { int ret = out_grouping_U(g_v, 1072, 1103, 1);
00339 if (ret < 0) goto lab0;
00340 c += ret;
00341 }
00342 { int ret = in_grouping_U(g_v, 1072, 1103, 1);
00343 if (ret < 0) goto lab0;
00344 c += ret;
00345 }
00346 I_p2 = c;
00347 lab0:
00348 c = c1;
00349 }
00350 return 1;
00351 }
00352
00353 int Xapian::InternalStemRussian::r_R2() {
00354 if (!(I_p2 <= c)) return 0;
00355 return 1;
00356 }
00357
00358 int Xapian::InternalStemRussian::r_perfective_gerund() {
00359 int among_var;
00360 ket = c;
00361 among_var = find_among_b(a_0, 9, 0, 0);
00362 if (!(among_var)) return 0;
00363 bra = c;
00364 switch(among_var) {
00365 case 0: return 0;
00366 case 1:
00367 { int m1 = l - c; (void)m1;
00368 if (!(eq_s_b(2, s_0))) goto lab1;
00369 goto lab0;
00370 lab1:
00371 c = l - m1;
00372 if (!(eq_s_b(2, s_1))) return 0;
00373 }
00374 lab0:
00375 if (slice_del() == -1) return -1;
00376 break;
00377 case 2:
00378 if (slice_del() == -1) return -1;
00379 break;
00380 }
00381 return 1;
00382 }
00383
00384 int Xapian::InternalStemRussian::r_adjective() {
00385 int among_var;
00386 ket = c;
00387 among_var = find_among_b(a_1, 26, 0, 0);
00388 if (!(among_var)) return 0;
00389 bra = c;
00390 switch(among_var) {
00391 case 0: return 0;
00392 case 1:
00393 if (slice_del() == -1) return -1;
00394 break;
00395 }
00396 return 1;
00397 }
00398
00399 int Xapian::InternalStemRussian::r_adjectival() {
00400 int among_var;
00401 { int ret = r_adjective();
00402 if (ret <= 0) return ret;
00403 }
00404 { int m1 = l - c; (void)m1;
00405 ket = c;
00406 among_var = find_among_b(a_2, 8, 0, 0);
00407 if (!(among_var)) { c = l - m1; goto lab0; }
00408 bra = c;
00409 switch(among_var) {
00410 case 0: { c = l - m1; goto lab0; }
00411 case 1:
00412 { int m2 = l - c; (void)m2;
00413 if (!(eq_s_b(2, s_2))) goto lab2;
00414 goto lab1;
00415 lab2:
00416 c = l - m2;
00417 if (!(eq_s_b(2, s_3))) { c = l - m1; goto lab0; }
00418 }
00419 lab1:
00420 if (slice_del() == -1) return -1;
00421 break;
00422 case 2:
00423 if (slice_del() == -1) return -1;
00424 break;
00425 }
00426 lab0:
00427 ;
00428 }
00429 return 1;
00430 }
00431
00432 int Xapian::InternalStemRussian::r_reflexive() {
00433 int among_var;
00434 ket = c;
00435 if (c - 3 <= lb || (p[c - 1] != 140 && p[c - 1] != 143)) return 0;
00436 among_var = find_among_b(a_3, 2, 0, 0);
00437 if (!(among_var)) return 0;
00438 bra = c;
00439 switch(among_var) {
00440 case 0: return 0;
00441 case 1:
00442 if (slice_del() == -1) return -1;
00443 break;
00444 }
00445 return 1;
00446 }
00447
00448 int Xapian::InternalStemRussian::r_verb() {
00449 int among_var;
00450 ket = c;
00451 among_var = find_among_b(a_4, 46, 0, 0);
00452 if (!(among_var)) return 0;
00453 bra = c;
00454 switch(among_var) {
00455 case 0: return 0;
00456 case 1:
00457 { int m1 = l - c; (void)m1;
00458 if (!(eq_s_b(2, s_4))) goto lab1;
00459 goto lab0;
00460 lab1:
00461 c = l - m1;
00462 if (!(eq_s_b(2, s_5))) return 0;
00463 }
00464 lab0:
00465 if (slice_del() == -1) return -1;
00466 break;
00467 case 2:
00468 if (slice_del() == -1) return -1;
00469 break;
00470 }
00471 return 1;
00472 }
00473
00474 int Xapian::InternalStemRussian::r_noun() {
00475 int among_var;
00476 ket = c;
00477 among_var = find_among_b(a_5, 36, 0, 0);
00478 if (!(among_var)) return 0;
00479 bra = c;
00480 switch(among_var) {
00481 case 0: return 0;
00482 case 1:
00483 if (slice_del() == -1) return -1;
00484 break;
00485 }
00486 return 1;
00487 }
00488
00489 int Xapian::InternalStemRussian::r_derivational() {
00490 int among_var;
00491 ket = c;
00492 if (c - 5 <= lb || (p[c - 1] != 130 && p[c - 1] != 140)) return 0;
00493 among_var = find_among_b(a_6, 2, 0, 0);
00494 if (!(among_var)) return 0;
00495 bra = c;
00496 { int ret = r_R2();
00497 if (ret <= 0) return ret;
00498 }
00499 switch(among_var) {
00500 case 0: return 0;
00501 case 1:
00502 if (slice_del() == -1) return -1;
00503 break;
00504 }
00505 return 1;
00506 }
00507
00508 int Xapian::InternalStemRussian::r_tidy_up() {
00509 int among_var;
00510 ket = c;
00511 among_var = find_among_b(a_7, 4, 0, 0);
00512 if (!(among_var)) return 0;
00513 bra = c;
00514 switch(among_var) {
00515 case 0: return 0;
00516 case 1:
00517 if (slice_del() == -1) return -1;
00518 ket = c;
00519 if (!(eq_s_b(2, s_6))) return 0;
00520 bra = c;
00521 if (!(eq_s_b(2, s_7))) return 0;
00522 if (slice_del() == -1) return -1;
00523 break;
00524 case 2:
00525 if (!(eq_s_b(2, s_8))) return 0;
00526 if (slice_del() == -1) return -1;
00527 break;
00528 case 3:
00529 if (slice_del() == -1) return -1;
00530 break;
00531 }
00532 return 1;
00533 }
00534
00535 int Xapian::InternalStemRussian::stem() {
00536 { int c1 = c;
00537 { int ret = r_mark_regions();
00538 if (ret == 0) goto lab0;
00539 if (ret < 0) return ret;
00540 }
00541 lab0:
00542 c = c1;
00543 }
00544 lb = c; c = l;
00545
00546 { int m2 = l - c; (void)m2;
00547 int mlimit2;
00548 if (c < I_pV) return 0;
00549 c = I_pV;
00550 mlimit2 = lb; lb = c;
00551 c = l - m2;
00552 { int m3 = l - c; (void)m3;
00553 { int m4 = l - c; (void)m4;
00554 { int ret = r_perfective_gerund();
00555 if (ret == 0) goto lab3;
00556 if (ret < 0) return ret;
00557 }
00558 goto lab2;
00559 lab3:
00560 c = l - m4;
00561 { int m5 = l - c; (void)m5;
00562 { int ret = r_reflexive();
00563 if (ret == 0) { c = l - m5; goto lab4; }
00564 if (ret < 0) return ret;
00565 }
00566 lab4:
00567 ;
00568 }
00569 { int m6 = l - c; (void)m6;
00570 { int ret = r_adjectival();
00571 if (ret == 0) goto lab6;
00572 if (ret < 0) return ret;
00573 }
00574 goto lab5;
00575 lab6:
00576 c = l - m6;
00577 { int ret = r_verb();
00578 if (ret == 0) goto lab7;
00579 if (ret < 0) return ret;
00580 }
00581 goto lab5;
00582 lab7:
00583 c = l - m6;
00584 { int ret = r_noun();
00585 if (ret == 0) goto lab1;
00586 if (ret < 0) return ret;
00587 }
00588 }
00589 lab5:
00590 ;
00591 }
00592 lab2:
00593 lab1:
00594 c = l - m3;
00595 }
00596 { int m7 = l - c; (void)m7;
00597 ket = c;
00598 if (!(eq_s_b(2, s_9))) { c = l - m7; goto lab8; }
00599 bra = c;
00600 if (slice_del() == -1) return -1;
00601 lab8:
00602 ;
00603 }
00604 { int m8 = l - c; (void)m8;
00605 { int ret = r_derivational();
00606 if (ret == 0) goto lab9;
00607 if (ret < 0) return ret;
00608 }
00609 lab9:
00610 c = l - m8;
00611 }
00612 { int m9 = l - c; (void)m9;
00613 { int ret = r_tidy_up();
00614 if (ret == 0) goto lab10;
00615 if (ret < 0) return ret;
00616 }
00617 lab10:
00618 c = l - m9;
00619 }
00620 lb = mlimit2;
00621 }
00622 c = lb;
00623 return 1;
00624 }
00625
00626 Xapian::InternalStemRussian::InternalStemRussian()
00627 : I_p2(0), I_pV(0)
00628 {
00629 }
00630
00631 Xapian::InternalStemRussian::~InternalStemRussian()
00632 {
00633 }
00634
00635 const char *
00636 Xapian::InternalStemRussian::get_description() const
00637 {
00638 return "russian";
00639 }