From 6dd4cd50233d9eddb204e3fb040b7d347c64730d Mon Sep 17 00:00:00 2001
From: Alexis Nasr <alexis.nasr@lif.univ-mrs.fr>
Date: Thu, 26 Apr 2018 11:12:24 +0200
Subject: [PATCH] fixed a bug in parser oracle concerning action IGNORE

---
 maca_trans_parser/src/maca_trans_parser_arc_eager_mcf2cff.c | 6 +++++-
 maca_trans_parser/src/oracle_parser_arc_eager.c             | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/maca_trans_parser/src/maca_trans_parser_arc_eager_mcf2cff.c b/maca_trans_parser/src/maca_trans_parser_arc_eager_mcf2cff.c
index 069452c..285f757 100644
--- a/maca_trans_parser/src/maca_trans_parser_arc_eager_mcf2cff.c
+++ b/maca_trans_parser/src/maca_trans_parser_arc_eager_mcf2cff.c
@@ -55,9 +55,12 @@ 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 */
@@ -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");
diff --git a/maca_trans_parser/src/oracle_parser_arc_eager.c b/maca_trans_parser/src/oracle_parser_arc_eager.c
index bb39f9d..db6ab15 100644
--- a/maca_trans_parser/src/oracle_parser_arc_eager.c
+++ b/maca_trans_parser/src/oracle_parser_arc_eager.c
@@ -50,7 +50,10 @@ int oracle_parser_arc_eager(config *c, word_buffer *ref, int root_label, int pun
   /* int s0_label_in_hyp; */
 
   /* 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);
-- 
GitLab