Skip to content
Snippets Groups Projects
Commit 44a039c7 authored by Alexis Nasr's avatar Alexis Nasr
Browse files

modified maca_tm_decoder so that it does not lemmatize when word does not have...

modified maca_tm_decoder so that it does not lemmatize when word does not have a POS (hack git status)
parent 3abce919
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ void print_header(mcd *m, feat_model *fm) ...@@ -63,7 +63,7 @@ void print_header(mcd *m, feat_model *fm)
for(i=0; i <fm->nbelem; i++){ for(i=0; i <fm->nbelem; i++){
fd = fm->array[i]; fd = fm->array[i];
if(fd->nbelem > 1){ if(fd->nbelem > 1){
printf("feature %d is a complex feature, skipping it\n", i); fprintf(stderr, "feature %d is a complex feature, skipping it\n", i);
} }
else{ else{
sfd = fd->array[0]; sfd = fd->array[0];
...@@ -76,7 +76,7 @@ void print_header(mcd *m, feat_model *fm) ...@@ -76,7 +76,7 @@ void print_header(mcd *m, feat_model *fm)
for(i=0; i <fm->nbelem; i++){ for(i=0; i <fm->nbelem; i++){
fd = fm->array[i]; fd = fm->array[i];
if(fd->nbelem > 1){ if(fd->nbelem > 1){
printf("feature %d is a complex feature, skipping it\n", i); fprintf(stderr, "feature %d is a complex feature, skipping it\n", i);
} }
else{ else{
sfd = fd->array[0]; sfd = fd->array[0];
......
...@@ -263,7 +263,7 @@ void maca_tm_decoder(context *ctx) ...@@ -263,7 +263,7 @@ void maca_tm_decoder(context *ctx)
fprintf(stdout, "***********************************\n"); fprintf(stdout, "***********************************\n");
fprintf(stdout, "%s ", ctx->machine->state_array[c->current_state_nb]->name); fprintf(stdout, "%s ", ctx->machine->state_array[c->current_state_nb]->name);
config_print(stdout, c); config_print(stdout, c);
classifier_print_vcode_array(stderr, classif, c, 4); classifier_print_vcode_array(stdout, classif, c, 4);
} }
result = movement_apply(c, mvt_code, classifier_get_output_tagset(classif), root_label, ctx->machine); result = movement_apply(c, mvt_code, classifier_get_output_tagset(classif), root_label, ctx->machine);
...@@ -272,8 +272,11 @@ void maca_tm_decoder(context *ctx) ...@@ -272,8 +272,11 @@ void maca_tm_decoder(context *ctx)
/* it is bm1 rather than b0 because the machine changed state after applying the pos movement */ /* it is bm1 rather than b0 because the machine changed state after applying the pos movement */
word_sprint_col_n(form_str, word_buffer_bm1(config_get_buffer(c)), mcd_get_form_col(ctx->mcd_struct)); word_sprint_col_n(form_str, word_buffer_bm1(config_get_buffer(c)), mcd_get_form_col(ctx->mcd_struct));
pos_str = dico_int2string(dico_pos, word_get_pos(word_buffer_bm1(config_get_buffer(c)))); pos_str = dico_int2string(dico_pos, word_get_pos(word_buffer_bm1(config_get_buffer(c))));
lemma_code = -1;
if(pos_str){
lemma_str = fplm_lookup_lemma(fplm, form_str, pos_str, ctx->verbose); lemma_str = fplm_lookup_lemma(fplm, form_str, pos_str, ctx->verbose);
lemma_code = dico_string2int(dico_forms, lemma_str); lemma_code = dico_string2int(dico_forms, lemma_str);
}
word_set_lemma(word_buffer_bm1(config_get_buffer(c)), lemma_code); word_set_lemma(word_buffer_bm1(config_get_buffer(c)), lemma_code);
/* printf("--------> form = %s pos = %s lemma = %s code = %d\n", form_str, pos_str, lemma_str, lemma_code); */ /* printf("--------> form = %s pos = %s lemma = %s code = %d\n", form_str, pos_str, lemma_str, lemma_code); */
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment