From 4ebe2ee021db4f9bb87d0b94df96ed39f98f8890 Mon Sep 17 00:00:00 2001
From: Alexis Nasr <alexis.nasr@lif.univ-mrs.fr>
Date: Thu, 25 May 2017 10:07:07 +0200
Subject: [PATCH] bug fixing in tagger

---
 maca_trans_parser/src/context.c               | 5 ++++-
 maca_trans_parser/src/simple_decoder_tagger.c | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/maca_trans_parser/src/context.c b/maca_trans_parser/src/context.c
index f375287..1e05f78 100644
--- a/maca_trans_parser/src/context.c
+++ b/maca_trans_parser/src/context.c
@@ -303,7 +303,10 @@ context *context_read_options(int argc, char *argv[])
 	break;
       case 'P':
 	ctx->f2p_filename = strdup(optarg);
-	ctx->f2p = form2pos_read(ctx->f2p_filename);
+	if(!strcmp(ctx->f2p_filename, "_") || !strcmp(ctx->f2p_filename, "NULL"))
+	  ctx->f2p = NULL;
+	else
+	  ctx->f2p = form2pos_read(ctx->f2p_filename);
 	break;
       case 'N':
 	ctx->dnn_model_filename = strdup(optarg);
diff --git a/maca_trans_parser/src/simple_decoder_tagger.c b/maca_trans_parser/src/simple_decoder_tagger.c
index f54b3c9..7e3811d 100644
--- a/maca_trans_parser/src/simple_decoder_tagger.c
+++ b/maca_trans_parser/src/simple_decoder_tagger.c
@@ -18,7 +18,7 @@ void add_signature_to_words_in_word_buffer(word_buffer *bf, form2pos *f2p)
 {
   int i;
   word *w;
-  char lower_form[100];
+  char lower_form[1000];
 
   for(i = word_buffer_get_nbelem(bf) - 1; i >=0  ; i--){
     w = word_buffer_get_word_n(bf, i);
@@ -46,7 +46,7 @@ void add_signature_to_words_in_word_buffer(word_buffer *bf, form2pos *f2p, dico
     signature = form2pos_get_signature(f2p, w->form);
     w->signature = signature;
     if(form2pos_word_is_non_ambiguous(f2p, w->form, &pos)){
-      /* printf("%s non ambigu code = %d \n", pos, dico_string2int(dico_pos, pos)); */
+      //      printf("%s non ambigu code = %d \n", pos, dico_string2int(dico_pos, pos)); 
       word_set_pos(w, dico_string2int(dico_pos, pos));
       
     }
-- 
GitLab