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

fixed a bug in parser oracle concerning action IGNORE

parent d8892b07
No related branches found
No related tags found
No related merge requests found
......@@ -55,10 +55,13 @@ void generate_training_file(FILE *output_file, context *ctx)
feat_vec *fv = feat_vec_new(feature_types_nb);
int sentence_nb = 0;
int root_label = dico_string2int(ctx->dico_labels, (char *) ctx->root_label);
int punct_label = dico_string2int(ctx->dico_labels, (char *) ctx->punct_label);
int punct_label = dico_string2int(ctx->dico_postags, (char *) ctx->punct_label);
word_buffer *ref = word_buffer_load_mcf(ctx->input_filename, ctx->mcd_struct);
FILE *mcf_file = myfopen(ctx->input_filename, "r");
fprintf(stderr, "punct label = %s code = %d\n", ctx->punct_label, punct_label);
/* create an mcd that corresponds to ctx->mcd_struct, but without gov and label */
/* the idea is to ignore syntax in the mcf file that will be read */
/* it is ugly !!! */
......@@ -148,6 +151,7 @@ int main(int argc, char *argv[])
}
ctx->dico_labels = dico_vec_get_dico(ctx->vocabs, (char *)"LABEL");
ctx->dico_postags = dico_vec_get_dico(ctx->vocabs, (char *)"POS");
if(ctx->dico_labels == NULL){
fprintf(stderr, "cannot find label names\n");
......
......@@ -52,6 +52,9 @@ int oracle_parser_arc_eager(config *c, word_buffer *ref, int root_label, int pun
/* if(!stack_is_empty(config_get_stack(c)) && !word_buffer_is_empty(config_get_buffer(c))){ */
// fprintf(stderr, "punct label = %d\n", punct_label);
b0 = word_buffer_b0(config_get_buffer(c));
b0_index = word_get_index(b0);
b0_gov_index = word_get_gov_index(word_buffer_get_word_n(ref, b0_index));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment