Home | History | Annotate | Download | only in src

Lines Matching refs:lm

68 static SWIsltsResult load_letter_mapping(PORT_FILE *fp, LM **ppLetterMap);
69 static SWIsltsResult free_letter_mapping(LM *lm);
75 LQUESTION ***pquestions, int *num_questions, LM **plm, PORT_FILE *fp);
76 static SWIsltsResult free_trees(RT_LTREE **trees, int num_letters, LQUESTION **questions, int num_questions, LM *lm);
253 static SWIsltsResult load_letter_mapping(PORT_FILE *fp, LM **ppLetterMap)
257 LM * lm;
261 lm = (LM*) lts_alloc(1, sizeof(LM));
262 if (lm == NULL) {
268 lm->num_letters = len;
270 lm->letters = (char*) lts_alloc(len, sizeof(char));
271 if (lm->letters == NULL) {
276 lm->type = (char*) lts_alloc(len, sizeof(char));
277 if (lm->type == NULL) {
282 PORT_FREAD_CHAR(lm->letters, sizeof(char), len, fp);
283 PORT_FREAD_CHAR(lm->type, sizeof(char), len, fp);
288 lm->letter_index_for_letter[letter] = LTS_MAXCHAR;
292 char letter = toupper(lm->letters[i]);
293 lm->letters[i] = letter;
294 lm->letter_index_for_letter[(unsigned char)letter] = i;
296 *ppLetterMap = lm;
300 free_letter_mapping(lm);
306 static SWIsltsResult free_letter_mapping(LM *lm)
310 if (lm) {
311 if (lm->letters) {
312 FREE(lm->letters);
313 lm->letters = NULL;
315 if (lm->type) {
316 FREE(lm->type);
317 lm->type = NULL;
319 lm->num_letters = 0;
320 FREE(lm);
499 LQUESTION ***pquestions, int *num_questions, LM **plm, PORT_FILE *fp)
615 LQUESTION **questions, int num_questions, LM *lm)
621 if (lm) {
622 free_letter_mapping(lm);
1007 LM *lm;
1014 lm = lts->letter_mapping;
1035 letter = find_letter_index(input_word[index], lm);
1054 dp->properties[ Left1+j] = find_letter_index(LTS_MARKER_PIPESEP_CHAR, lm);
1057 if (i < 0) dp->properties[ Left1+j] = find_letter_index(LTS_MARKER_PIPESEP_CHAR, lm);
1059 dp->properties[ Left1+j] = find_letter_index(input_word[i], lm);
1061 dp->properties[ Left1+j] = find_letter_index(LTS_MARKER_PIPESEP_CHAR, lm);
1073 dp->properties[ Right1+j] = find_letter_index(LTS_MARKER_PIPESEP_CHAR, lm);
1076 if (i >= word_len) dp->properties[Right1+j] = find_letter_index(LTS_MARKER_PIPESEP_CHAR, lm);
1078 dp->properties[ Right1+j] = find_letter_index(input_word[i], lm);
1080 dp->properties[ Right1+j] = find_letter_index(LTS_MARKER_PIPESEP_CHAR, lm);
1102 word[i] = find_letter_index(input_word[i], lm);
1110 if (lm->type[word[i]] == 1) {
1112 if (lm->type[word[j]] != 1) break;
1120 if (lm->type[word[i]] == 1) {
1122 if (lm->type[word[j]] != 1) break;
1139 if (lm->type[word[i]] == 1) {
1141 if (lm->type[word[j]] != 1) break;
1144 if (lm->type[word[j]] == 1) break;
1152 if (lm->type[word[i]] == 1) {
1154 if (lm->type[word[j]] != 1) break;
1157 if (lm->type[word[j]] == 1) break;
1175 if (lm->type[word[i]] == 1) {
1177 if (lm->type[word[j]] != 1) break;
1185 if (lm->type[word[i]] == 1) {
1187 if (lm->type[word[j]] != 1) break;
1204 if (lm->type[word[i]] == 1) {
1206 if (lm->type[word[j]] != 1) break;
1209 if (lm->type[word[j]] == 1) break;
1217 if (lm->type[word[i]] == 1) {
1219 if (lm->type[word[j]] != 1) break;
1222 if (lm->type[word[j]] == 1) break;
1254 pfprintf(PSTDOUT,"dp %c ", lm->letters[dp->letter]);
1257 pfprintf(PSTDOUT,"%c", lm->letters[word[i]]);
1260 lm->letters[dp->left_context[2]],
1261 lm->letters[dp->left_context[1]],
1262 lm->letters[dp->left_context[0]],
1263 lm->letters[dp->letter],
1264 lm->letters[dp->right_context[0]],
1265 lm->letters[dp->right_context[1]],
1266 lm->letters[dp->right_context[2]],