From 87fdf274e27bb03669cb8a1c40e507b02c742b9b Mon Sep 17 00:00:00 2001
From: Alexis Nasr <alexis.nasr@lif.univ-mrs.fr>
Date: Mon, 5 Feb 2018 08:48:13 +0100
Subject: [PATCH] added three different features to words : SPEAKER DIRECORY
 FILE

---
 maca_common/include/mcd.h                       | 8 +++++++-
 maca_common/src/mcd.c                           | 6 ++++++
 maca_common/src/word.c                          | 1 -
 maca_trans_parser/src/oracle_parser_arc_eager.c | 5 +++--
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/maca_common/include/mcd.h b/maca_common/include/mcd.h
index a86626f..aa4ade6 100644
--- a/maca_common/include/mcd.h
+++ b/maca_common/include/mcd.h
@@ -8,7 +8,7 @@
 
 #define MCD_INVALID_VALUE -1
 
-#define MCD_WF_NB 48
+#define MCD_WF_NB 51
 
 #define MCD_WF_ID 0
 #define MCD_WF_OFFSET 0 /* ID and OFFSET are synonymous */
@@ -61,6 +61,12 @@
 #define MCD_WF_Person 45
 #define MCD_WF_Tense 46
 
+#define MCD_WF_FILE 47
+#define MCD_WF_DIRECTORY 48
+#define MCD_WF_SPEAKER 49
+
+
+
 /*Abbr
 AdpType
 AdvType
diff --git a/maca_common/src/mcd.c b/maca_common/src/mcd.c
index 4a2348e..34fd53b 100644
--- a/maca_common/src/mcd.c
+++ b/maca_common/src/mcd.c
@@ -512,6 +512,12 @@ int mcd_wf_code(char *wf)
   /* if(!strcmp(wf, "INT")) return MCD_WF_INT; */
   if(!strcmp(wf, "GOV")) return MCD_WF_GOV;
   if(!strcmp(wf, "SENT_SEG")) return MCD_WF_SENT_SEG;
+
+  if(!strcmp(wf, "FILE")) return MCD_WF_FILE;
+  if(!strcmp(wf, "DIRECTORY")) return MCD_WF_DIRECTORY;
+  if(!strcmp(wf, "SPEAKER")) return MCD_WF_SPEAKER;
+
+  
   if(!strcmp(wf, "A")) return MCD_WF_A;
   if(!strcmp(wf, "B")) return MCD_WF_B;
   if(!strcmp(wf, "C")) return MCD_WF_C;
diff --git a/maca_common/src/word.c b/maca_common/src/word.c
index 21e303e..33f27da 100644
--- a/maca_common/src/word.c
+++ b/maca_common/src/word.c
@@ -22,7 +22,6 @@ word *word_new(char *input)
   w->wf_array[MCD_WF_GOV] = WORD_INVALID_GOV;
   w->form = NULL;
   w->form_char16 = NULL;
-
   w->index = -1;
   w->signature = -1;
   w->is_root = 0;
diff --git a/maca_trans_parser/src/oracle_parser_arc_eager.c b/maca_trans_parser/src/oracle_parser_arc_eager.c
index 7a34fcd..3440c70 100644
--- a/maca_trans_parser/src/oracle_parser_arc_eager.c
+++ b/maca_trans_parser/src/oracle_parser_arc_eager.c
@@ -61,17 +61,18 @@ int oracle_parser_arc_eager(config *c, word_buffer *ref, int root_label)
 	  printf("dans ref gov de b0 (%d) = %d\n", b0_index, b0_gov_index);*/
 
     /* s0 is the root of the sentence */
-    /*    if((s0_label == root_label)
+    if((s0_label == root_label)
        && check_all_dependents_of_word_in_ref_are_in_hyp(c, ref, s0_index)
        ){
       return MVT_PARSER_ROOT;
-      }*/
+    }
 
     /* word on the top of the stack is an end of sentence marker */
     if((word_get_sent_seg(word_buffer_get_word_n(ref, s0_index)) == 1)
        && (word_get_sent_seg(word_buffer_get_word_n(config_get_buffer(c), s0_index)) != 1)){
       return MVT_PARSER_EOS;
       }
+
     /* LEFT ARC  b0 is the governor and s0 the dependent */
     if(s0_gov_index == b0_index){
       return movement_parser_left_code(word_get_label(word_buffer_get_word_n(ref, s0_index)));
-- 
GitLab