From 7af41f41d36e2ae917b476ced7efac0cdc3d5f25 Mon Sep 17 00:00:00 2001
From: Alexis Nasr <alexis.nasr@lif.univ-mrs.fr>
Date: Tue, 20 Feb 2018 22:14:33 +0100
Subject: [PATCH] added maca_check_projectivity that computes the ratio of non
 projective dependencies in a mcf file

---
 maca_trans_parser/CMakeLists.txt                | 6 ++++++
 maca_trans_parser/src/movements.c               | 1 +
 maca_trans_parser/src/oracle_parser_arc_eager.c | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/maca_trans_parser/CMakeLists.txt b/maca_trans_parser/CMakeLists.txt
index fe60c66..9f172a5 100644
--- a/maca_trans_parser/CMakeLists.txt
+++ b/maca_trans_parser/CMakeLists.txt
@@ -43,6 +43,12 @@ target_link_libraries(transparse perceptron)
 #target_link_libraries(maca_trans_parser_nn maca_common)
 #install (TARGETS maca_trans_parser_nn DESTINATION bin)
 
+add_executable(maca_check_projectivity ./src/maca_check_projectivity.c)
+target_link_libraries(maca_check_projectivity perceptron)
+target_link_libraries(maca_check_projectivity transparse)
+target_link_libraries(maca_check_projectivity maca_common)
+install (TARGETS maca_check_projectivity DESTINATION bin)
+
 add_executable(maca_trans_lemmatizer_mcf2cff ./src/maca_trans_lemmatizer_mcf2cff.c)
 target_link_libraries(maca_trans_lemmatizer_mcf2cff perceptron)
 target_link_libraries(maca_trans_lemmatizer_mcf2cff transparse)
diff --git a/maca_trans_parser/src/movements.c b/maca_trans_parser/src/movements.c
index ae0c06c..53e1e8c 100644
--- a/maca_trans_parser/src/movements.c
+++ b/maca_trans_parser/src/movements.c
@@ -84,6 +84,7 @@ int movement_right_arc_undo(config *c)
 int movement_ignore(config *c, int movement_code)
 {
   if(word_buffer_end(config_get_buffer(c))) return 0;
+  word *b0 = word_buffer_b0(config_get_buffer(c));
   config_push_mvt(c, movement_code, b0, NULL);
   word_buffer_move_right(config_get_buffer(c));
   return 1;
diff --git a/maca_trans_parser/src/oracle_parser_arc_eager.c b/maca_trans_parser/src/oracle_parser_arc_eager.c
index fd8199a..0bc5fe0 100644
--- a/maca_trans_parser/src/oracle_parser_arc_eager.c
+++ b/maca_trans_parser/src/oracle_parser_arc_eager.c
@@ -59,7 +59,7 @@ int oracle_parser_arc_eager(config *c, word_buffer *ref, int root_label)
     /*    printf("s0_index = %d b0_index = %d\n", s0_index, b0_index);  
 	  printf("dans ref gov de s0 (%d) = %d\n", s0_index, s0_gov_index);
 	  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)
        //       && (word_get_label(word_buffer_get_word_n(config_get_buffer(c), s0_index)) != root_label)
-- 
GitLab