From b86a0bf2d76d3bb433727dd88daeaae84affecf9 Mon Sep 17 00:00:00 2001 From: Alexis Nasr <alexis.nasr@lif.univ-mrs.fr> Date: Thu, 12 Apr 2018 16:27:43 +0200 Subject: [PATCH] bug fixing in maca_corpora --- maca_corpora/exec/ftb2fr.c | 6 +- maca_corpora/exec/ptb2en.c | 10 +- maca_corpora/lib/src/ftb_lib.c | 20 +-- maca_corpora/lib/src/orfeo_lib.c | 242 +++++++++++++++---------------- 4 files changed, 139 insertions(+), 139 deletions(-) diff --git a/maca_corpora/exec/ftb2fr.c b/maca_corpora/exec/ftb2fr.c index 6d422ba..ebf4954 100644 --- a/maca_corpora/exec/ftb2fr.c +++ b/maca_corpora/exec/ftb2fr.c @@ -20,7 +20,7 @@ typedef struct options void change_pos_fr(conll_sentence *s, hash_str *h_pos) { - int i; + unsigned i; conll_word *w; char *val; @@ -56,7 +56,7 @@ void change_pos_fr(conll_sentence *s, hash_str *h_pos) void change_pos_and_cpos_of_dot(conll_sentence *s, options *op) { - int i; + unsigned i; conll_word *w; for(i=1; i < s->l; i++){ @@ -223,7 +223,7 @@ int main(int argc, char *argv[]) change_pos_fr(s, op.h_pos); /* change_label_of_last_dep(s); */ ftb_retokenize_three_dots(s); - ftb_tokenize_dot(s, "titre", "poncts", "abbrev"); + ftb_tokenize_dot(s, (char *) "titre", (char *) "poncts", (char *) "abbrev"); conll_renumber_sentence(s); // conll_compute_relative_index_of_heads(s); conll_print_sentence(s); diff --git a/maca_corpora/exec/ptb2en.c b/maca_corpora/exec/ptb2en.c index d5545d7..a7c5715 100644 --- a/maca_corpora/exec/ptb2en.c +++ b/maca_corpora/exec/ptb2en.c @@ -19,7 +19,7 @@ typedef struct options void tokenize_dot_ptb(conll_sentence *s, char *dep_postag, char *label) { - int i; + unsigned i; conll_word *w; for(i=1; i<s->l; i++){ @@ -34,7 +34,7 @@ void tokenize_dot_ptb(conll_sentence *s, char *dep_postag, char *label) // strcpy(abbrev->cpostag, gov_postag); if(w->lemma[strlen(w->lemma) - 1] == '.') abbrev->lemma[strlen(abbrev->lemma) - 1] = '\0'; /* conll_word *dot = conll_allocate_word(i, ".", ".", "poncts", "poncts", "NULL", -1, "abbrev"); */ - conll_word *dot = conll_allocate_word(i, ".", ".", dep_postag, dep_postag, "_", -1, label); + conll_word *dot = conll_allocate_word(i, (char *) ".", (char *) ".", dep_postag, dep_postag, (char *) "_", -1, label); conll_split_node_in_two(s, i, abbrev, dot, i, i+1); @@ -45,7 +45,7 @@ void tokenize_dot_ptb(conll_sentence *s, char *dep_postag, char *label) void change_pos_and_cpos_of_dot(conll_sentence *s, options *op) { - int i; + unsigned i; conll_word *w; for(i=1; i < s->l; i++){ @@ -61,7 +61,7 @@ void change_pos_and_cpos_of_dot(conll_sentence *s, options *op) void print_sentence_no_newline_en(conll_sentence *s) { - int i; + unsigned i; conll_word *w; if((s->l == 1) || (s->l == 0)) return; @@ -261,7 +261,7 @@ int main(int argc, char *argv[]) //change_pos_fr(s, op.h_pos); /* change_label_of_last_dep(s); */ //retokenize_three_dots(s); - tokenize_dot_ptb(s, ".", "ABBREV"); + tokenize_dot_ptb(s, (char *) ".", (char *)"ABBREV"); conll_renumber_sentence(s); // conll_compute_relative_index_of_heads(s); // print_sentence_no_newline_en(s); diff --git a/maca_corpora/lib/src/ftb_lib.c b/maca_corpora/lib/src/ftb_lib.c index fbf6630..2376ce4 100644 --- a/maca_corpora/lib/src/ftb_lib.c +++ b/maca_corpora/lib/src/ftb_lib.c @@ -7,7 +7,7 @@ void ftb_change_root_head(conll_sentence *s, int new_head_index) { - int i; + unsigned i; conll_word *w; for(i=1; i<s->l; i++){ @@ -21,7 +21,7 @@ void ftb_change_root_head(conll_sentence *s, int new_head_index) int ftb_get_root_index(conll_sentence *s) { - int i; + unsigned i; conll_word *w; for(i=1; i<s->l; i++){ @@ -45,7 +45,7 @@ int ftb_sentence_ends_with_poncts(conll_sentence *s) int ftb_number_of_roots_in_sentence(conll_sentence *s) { - int i; + unsigned i; conll_word *w; int root_nb = 0; @@ -59,7 +59,7 @@ int ftb_number_of_roots_in_sentence(conll_sentence *s) int ftb_sentence_contains_missinghead(conll_sentence *s) { - int i; + unsigned i; conll_word *w; for(i=1; i<s->l; i++){ @@ -73,7 +73,7 @@ int ftb_sentence_contains_missinghead(conll_sentence *s) void ftb_change_form_and_lemma_of_numbers(conll_sentence *s) { - int i; + unsigned i; conll_word *w; for(i=1; i<s->l; i++){ @@ -97,9 +97,9 @@ void ftb_change_label_of_last_dep(conll_sentence *s) void ftb_retokenize_three_dots(conll_sentence *s) { - int i; + unsigned i; conll_word *w; - int l = s->l; + unsigned l = s->l; for(i=1; i < l-2; i++){ w = s->words[i]; if(w){ @@ -120,7 +120,7 @@ void ftb_retokenize_three_dots(conll_sentence *s) void ftb_tokenize_dot(conll_sentence *s, char *gov_postag, char *dep_postag, char *label) { - int i; + unsigned i; conll_word *w; for(i=1; i<s->l; i++){ @@ -135,7 +135,7 @@ void ftb_tokenize_dot(conll_sentence *s, char *gov_postag, char *dep_postag, cha strcpy(abbrev->cpostag, gov_postag); if(w->lemma[strlen(w->lemma) - 1] == '.') abbrev->lemma[strlen(abbrev->lemma) - 1] = '\0'; /* conll_word *dot = allocate_word(i, ".", ".", "poncts", "poncts", "NULL", -1, "abbrev"); */ - conll_word *dot = conll_allocate_word(i, ".", ".", dep_postag, dep_postag, "NULL", -1, label); + conll_word *dot = conll_allocate_word(i, (char *) ".", (char *) ".", dep_postag, dep_postag, (char *) "NULL", -1, label); conll_split_node_in_two(s, i, abbrev, dot, i, i+1); @@ -147,7 +147,7 @@ void ftb_tokenize_dot(conll_sentence *s, char *gov_postag, char *dep_postag, cha void ftb_print_sentence_no_newline(conll_sentence *s) { - int i; + unsigned i; conll_word *w; if((s->l == 1) || (s->l == 0)) return; diff --git a/maca_corpora/lib/src/orfeo_lib.c b/maca_corpora/lib/src/orfeo_lib.c index 18d8906..8cc3774 100644 --- a/maca_corpora/lib/src/orfeo_lib.c +++ b/maca_corpora/lib/src/orfeo_lib.c @@ -10,8 +10,8 @@ void traite_au_revoir(conll_sentence *s, int pos) { - conll_word *au = conll_allocate_word(-1, "au", "au", "prep", "prep", "NULL", -1, "NULL"); - conll_word *revoir = conll_allocate_word(-1, "revoir", "revoir", "nc", "nc", "NULL", -1, "OBJ"); + conll_word *au = conll_allocate_word(-1, (char *) "au", (char *) "au", (char *) "prep", (char *) "prep", (char *) "NULL", -1, (char *) "NULL"); + conll_word *revoir = conll_allocate_word(-1, (char *) "revoir", (char *) "revoir", (char *) "nc", (char *) "nc", (char *) "NULL", -1, (char *) "OBJ"); conll_split_node_in_two(s, pos, au, revoir, pos, pos+1); } @@ -35,8 +35,8 @@ void traite_ADV_que(conll_sentence *s, char *form, int pos) } form_que[j] = '\0'; - conll_word *que = conll_allocate_word(-1, form_que, "que", "CSU", "CSU", "NULL", -1, "NULL"); - conll_word *adv = conll_allocate_word(-1, form_adv, form_adv, "ADV", "ADV", "NULL", -1, "MORPH"); + conll_word *que = conll_allocate_word(-1, form_que, (char *) "que", (char *) "CSU", (char *) "CSU", (char *) "NULL", -1, (char *) "NULL"); + conll_word *adv = conll_allocate_word(-1, form_adv, form_adv, (char *) "ADV", (char *) "ADV", (char *) "NULL", -1, (char *) "MORPH"); conll_split_node_in_two(s, pos, que, adv, pos+1, pos); @@ -97,23 +97,23 @@ int chaine_possede_un_plus_ou_un_moins(char *m) void orfeo_traite_mots_composes(conll_sentence *s) { - int i; + unsigned i; conll_word *w; for(i=1; i<s->l; i++){ w = s->words[i]; if(chaine_possede_un_plus(w->form)){ - if(!strcmp(w->form, "au+revoir")) traite_au_revoir(s, i); + if(!strcmp(w->form, (char *) "au+revoir")) traite_au_revoir(s, i); } else if(chaine_possede_un_underscore(w->form)){ - if(!strcmp(w->form, "bien_que") || !strcmp(w->form, "bien_qu'") || !strcmp(w->form, "Bien_que") || !strcmp(w->form, "Bien_qu'") - || !strcmp(w->form, "ainsi_que") || !strcmp(w->form, "ainsi_qu'") || !strcmp(w->form, "Ainsi_que") || !strcmp(w->form, "Ainsi_qu'") - || !strcmp(w->form, "autant_que") || !strcmp(w->form, "autant_qu'") || !strcmp(w->form, "Autant_que") || !strcmp(w->form, "Autant_qu'") - || !strcmp(w->form, "alors_que") || !strcmp(w->form, "alors_qu'") || !strcmp(w->form, "Alors_que") || !strcmp(w->form, "Alors_qu'") - || !strcmp(w->form, "maintenant_que") || !strcmp(w->form, "mainenant_qu'") || !strcmp(w->form, "Maintenant_que") || !strcmp(w->form, "Mainenant_qu'") - || !strcmp(w->form, "encore_que") || !strcmp(w->form, "encore_qu'") || !strcmp(w->form, "Encore_que") || !strcmp(w->form, "Encore_qu'") - || !strcmp(w->form, "plus_que") || !strcmp(w->form, "plus_qu'") || !strcmp(w->form, "Plus_que") || !strcmp(w->form, "Plus_qu'") - || !strcmp(w->form, "tant_que") || !strcmp(w->form, "tant_qu'") || !strcmp(w->form, "Tant_que") || !strcmp(w->form, "Tant_qu'")) + if(!strcmp(w->form, (char *) "bien_que") || !strcmp(w->form, (char *) "bien_qu'") || !strcmp(w->form, (char *) "Bien_que") || !strcmp(w->form, (char *) "Bien_qu'") + || !strcmp(w->form, (char *) "ainsi_que") || !strcmp(w->form, (char *) "ainsi_qu'") || !strcmp(w->form, (char *) "Ainsi_que") || !strcmp(w->form, (char *) "Ainsi_qu'") + || !strcmp(w->form, (char *) "autant_que") || !strcmp(w->form, (char *) "autant_qu'") || !strcmp(w->form, (char *) "Autant_que") || !strcmp(w->form, (char *) "Autant_qu'") + || !strcmp(w->form, (char *) "alors_que") || !strcmp(w->form, (char *) "alors_qu'") || !strcmp(w->form, (char *) "Alors_que") || !strcmp(w->form, (char *) "Alors_qu'") + || !strcmp(w->form, (char *) "maintenant_que") || !strcmp(w->form, (char *) "mainenant_qu'") || !strcmp(w->form, (char *) "Maintenant_que") || !strcmp(w->form, (char *) "Mainenant_qu'") + || !strcmp(w->form, (char *) "encore_que") || !strcmp(w->form, (char *) "encore_qu'") || !strcmp(w->form, (char *) "Encore_que") || !strcmp(w->form, (char *) "Encore_qu'") + || !strcmp(w->form, (char *) "plus_que") || !strcmp(w->form, (char *) "plus_qu'") || !strcmp(w->form, (char *) "Plus_que") || !strcmp(w->form, (char *) "Plus_qu'") + || !strcmp(w->form, (char *) "tant_que") || !strcmp(w->form, (char *) "tant_qu'") || !strcmp(w->form, (char *) "Tant_que") || !strcmp(w->form, (char *) "Tant_qu'")) traite_ADV_que(s, w->form, i); } } @@ -130,38 +130,38 @@ void orfeo_traite_mots_composes(conll_sentence *s) int chaine_est_un_chiffre(char *s) { - if(!strcmp(s, "et")) return 1; - if(!strcmp(s, "zéro")) return 1; - if(!strcmp(s, "un")) return 1; - if(!strcmp(s, "deux")) return 1; - if(!strcmp(s, "trois")) return 1; - if(!strcmp(s, "quatre")) return 1; - if(!strcmp(s, "cinq")) return 1; - if(!strcmp(s, "six")) return 1; - if(!strcmp(s, "sept")) return 1; - if(!strcmp(s, "huit")) return 1; - if(!strcmp(s, "neuf")) return 1; - if(!strcmp(s, "dix")) return 1; - if(!strcmp(s, "onze")) return 1; - if(!strcmp(s, "douze")) return 1; - if(!strcmp(s, "treize")) return 1; - if(!strcmp(s, "quatorze")) return 1; - if(!strcmp(s, "quinze")) return 1; - if(!strcmp(s, "seize")) return 1; - if(!strcmp(s, "vingt")) return 1; - if(!strcmp(s, "vingts")) return 1; - if(!strcmp(s, "trente")) return 1; - if(!strcmp(s, "quarante")) return 1; - if(!strcmp(s, "cinquante")) return 1; - if(!strcmp(s, "soixante")) return 1; - if(!strcmp(s, "cent")) return 1; - if(!strcmp(s, "cents")) return 1; - if(!strcmp(s, "mille")) return 1; - if(!strcmp(s, "milles")) return 1; - if(!strcmp(s, "million")) return 1; - if(!strcmp(s, "millions")) return 1; - if(!strcmp(s, "milliard")) return 1; - if(!strcmp(s, "milliards")) return 1; + if(!strcmp(s, (char *) "et")) return 1; + if(!strcmp(s, (char *) "zéro")) return 1; + if(!strcmp(s, (char *) "un")) return 1; + if(!strcmp(s, (char *) "deux")) return 1; + if(!strcmp(s, (char *) "trois")) return 1; + if(!strcmp(s, (char *) "quatre")) return 1; + if(!strcmp(s, (char *) "cinq")) return 1; + if(!strcmp(s, (char *) "six")) return 1; + if(!strcmp(s, (char *) "sept")) return 1; + if(!strcmp(s, (char *) "huit")) return 1; + if(!strcmp(s, (char *) "neuf")) return 1; + if(!strcmp(s, (char *) "dix")) return 1; + if(!strcmp(s, (char *) "onze")) return 1; + if(!strcmp(s, (char *) "douze")) return 1; + if(!strcmp(s, (char *) "treize")) return 1; + if(!strcmp(s, (char *) "quatorze")) return 1; + if(!strcmp(s, (char *) "quinze")) return 1; + if(!strcmp(s, (char *) "seize")) return 1; + if(!strcmp(s, (char *) "vingt")) return 1; + if(!strcmp(s, (char *) "vingts")) return 1; + if(!strcmp(s, (char *) "trente")) return 1; + if(!strcmp(s, (char *) "quarante")) return 1; + if(!strcmp(s, (char *) "cinquante")) return 1; + if(!strcmp(s, (char *) "soixante")) return 1; + if(!strcmp(s, (char *) "cent")) return 1; + if(!strcmp(s, (char *) "cents")) return 1; + if(!strcmp(s, (char *) "mille")) return 1; + if(!strcmp(s, (char *) "milles")) return 1; + if(!strcmp(s, (char *) "million")) return 1; + if(!strcmp(s, (char *) "millions")) return 1; + if(!strcmp(s, (char *) "milliard")) return 1; + if(!strcmp(s, (char *) "milliards")) return 1; return 0; } @@ -169,35 +169,35 @@ int chaine_est_un_chiffre(char *s) int chaine_est_un_chiffre_sauf_un(char *s) { - if(!strcmp(s, "zéro")) return 1; - if(!strcmp(s, "deux")) return 1; - if(!strcmp(s, "trois")) return 1; - if(!strcmp(s, "quatre")) return 1; - if(!strcmp(s, "cinq")) return 1; - if(!strcmp(s, "six")) return 1; - if(!strcmp(s, "sept")) return 1; - if(!strcmp(s, "huit")) return 1; - if(!strcmp(s, "neuf")) return 1; - if(!strcmp(s, "dix")) return 1; - if(!strcmp(s, "onze")) return 1; - if(!strcmp(s, "douze")) return 1; - if(!strcmp(s, "treize")) return 1; - if(!strcmp(s, "quatorze")) return 1; - if(!strcmp(s, "quinze")) return 1; - if(!strcmp(s, "seize")) return 1; - if(!strcmp(s, "vingt")) return 1; - if(!strcmp(s, "trente")) return 1; - if(!strcmp(s, "quarante")) return 1; - if(!strcmp(s, "cinquante")) return 1; - if(!strcmp(s, "soixante")) return 1; - if(!strcmp(s, "cent")) return 1; - if(!strcmp(s, "cents")) return 1; - if(!strcmp(s, "mille")) return 1; - if(!strcmp(s, "milles")) return 1; - if(!strcmp(s, "million")) return 1; - if(!strcmp(s, "millions")) return 1; - if(!strcmp(s, "milliard")) return 1; - if(!strcmp(s, "milliards")) return 1; + if(!strcmp(s, (char *) "zéro")) return 1; + if(!strcmp(s, (char *) "deux")) return 1; + if(!strcmp(s, (char *) "trois")) return 1; + if(!strcmp(s, (char *) "quatre")) return 1; + if(!strcmp(s, (char *) "cinq")) return 1; + if(!strcmp(s, (char *) "six")) return 1; + if(!strcmp(s, (char *) "sept")) return 1; + if(!strcmp(s, (char *) "huit")) return 1; + if(!strcmp(s, (char *) "neuf")) return 1; + if(!strcmp(s, (char *) "dix")) return 1; + if(!strcmp(s, (char *) "onze")) return 1; + if(!strcmp(s, (char *) "douze")) return 1; + if(!strcmp(s, (char *) "treize")) return 1; + if(!strcmp(s, (char *) "quatorze")) return 1; + if(!strcmp(s, (char *) "quinze")) return 1; + if(!strcmp(s, (char *) "seize")) return 1; + if(!strcmp(s, (char *) "vingt")) return 1; + if(!strcmp(s, (char *) "trente")) return 1; + if(!strcmp(s, (char *) "quarante")) return 1; + if(!strcmp(s, (char *) "cinquante")) return 1; + if(!strcmp(s, (char *) "soixante")) return 1; + if(!strcmp(s, (char *) "cent")) return 1; + if(!strcmp(s, (char *) "cents")) return 1; + if(!strcmp(s, (char *) "mille")) return 1; + if(!strcmp(s, (char *) "milles")) return 1; + if(!strcmp(s, (char *) "million")) return 1; + if(!strcmp(s, (char *) "millions")) return 1; + if(!strcmp(s, (char *) "milliard")) return 1; + if(!strcmp(s, (char *) "milliards")) return 1; return 0; } @@ -210,7 +210,7 @@ int chaine_composee_de_digits(char *orig) int i; int l = strlen(orig); - if(!strcmp(orig, ",")) return 0; + if(!strcmp(orig, (char *) ",")) return 0; for(i=0; i<l; i++) if(((orig[i] > '9') || (orig[i] < '0')) && (orig[i] != ',')) @@ -229,9 +229,9 @@ int chaine_est_un_nombre(char *orig) if(chaine_composee_de_digits(orig)) return 1; if(chaine_est_un_chiffre_sauf_un(orig)) return 1; if(!chaine_possede_un_plus_ou_un_moins(orig)) return 0; - if(!strcmp(orig, "-")) return 0; + if(!strcmp(orig, (char *) "-")) return 0; s = strdup(orig); - for(c = strtok(s, "+-"); c; c = strtok(NULL, "+-")){ + for(c = strtok(s, (char *) "+-"); c; c = strtok(NULL, (char *) "+-")){ if(!chaine_est_un_chiffre(c)){ free(s); return 0; @@ -246,14 +246,14 @@ int chaine_est_un_nombre(char *orig) void orfeo_traite_nombres(conll_sentence *s) { - int i; + unsigned i; conll_word *w; for(i=1; i<s->l; i++){ w = s->words[i]; if(chaine_est_un_nombre(w->form)){ /* printf("word = %s lemma = %s\n", w->form, w->lemma); */ - strcpy(w->lemma, "NUM"); + strcpy(w->lemma, (char *) "NUM"); } } } @@ -268,9 +268,9 @@ void traite_amalgame_du(conll_sentence *s, int i) w = s->words[i]; if((w->mother) && (w->daughters_nb > 0)){ dep1 = w->daughters[0]; - strcpy(w->form, "de"); - strcpy(w->lemma, "de"); - w2 = conll_allocate_word(i, "le", "le", "DET", "DET", "NULL", 0, "SPEC"); + strcpy(w->form, (char *) "de"); + strcpy(w->lemma, (char *) "de"); + w2 = conll_allocate_word(i, (char *) "le", (char *) "le", (char *) "DET", (char *) "DET", (char *) "NULL", 0, (char *) "SPEC"); conll_add_word(s, w2, i+1, dep1); } } @@ -281,9 +281,9 @@ void traite_amalgame_des(conll_sentence *s, int i) w = s->words[i]; if((w->mother) && (w->daughters_nb > 0)){ dep1 = w->daughters[0]; - strcpy(w->form, "de"); - strcpy(w->lemma, "de"); - w2 = conll_allocate_word(i, "les", "le", "DET", "DET", "NULL", 0, "SPEC"); + strcpy(w->form, (char *) "de"); + strcpy(w->lemma, (char *) "de"); + w2 = conll_allocate_word(i, (char *) "les", (char *) "le", (char *) "DET", (char *) "DET", (char *) "NULL", 0, (char *) "SPEC"); conll_add_word(s, w2, i+1, dep1); } } @@ -295,9 +295,9 @@ void traite_amalgame_au(conll_sentence *s, int i) w = s->words[i]; if((w->mother) && (w->daughters_nb > 0)){ dep1 = w->daughters[0]; - strcpy(w->form, "à"); - strcpy(w->lemma, "à"); - w2 = conll_allocate_word(i, "le", "le", "DET", "DET", "NULL", 0, "SPEC"); + strcpy(w->form, (char *) "à"); + strcpy(w->lemma, (char *) "à"); + w2 = conll_allocate_word(i, (char *) "le", (char *) "le", (char *) "DET", (char *) "DET", (char *) "NULL", 0, (char *) "SPEC"); conll_add_word(s, w2, i+1, dep1); } } @@ -308,9 +308,9 @@ void traite_amalgame_aux(conll_sentence *s, int i) w = s->words[i]; if((w->mother) && (w->daughters_nb > 0)){ dep1 = w->daughters[0]; - strcpy(w->form, "à"); - strcpy(w->lemma, "à"); - w2 = conll_allocate_word(i, "les", "le", "DET", "DET", "NULL", 0, "SPEC"); + strcpy(w->form, (char *) "à"); + strcpy(w->lemma, (char *) "à"); + w2 = conll_allocate_word(i, (char *) "les", (char *) "le", (char *) "DET", (char *) "DET", (char *) "NULL", 0, (char *) "SPEC"); conll_add_word(s, w2, i+1, dep1); } } @@ -321,9 +321,9 @@ void traite_amalgame_auquel(conll_sentence *s, int i) w = s->words[i]; if((w->mother) && (w->daughters_nb > 0)){ dep1 = w->daughters[0]; - strcpy(w->form, "à"); - strcpy(w->lemma, "à"); - w2 = conll_allocate_word(i, "lequel", "lequel", "PRQ", "PRQ", "NULL", 0, "PRQ"); + strcpy(w->form, (char *) "à"); + strcpy(w->lemma, (char *) "à"); + w2 = conll_allocate_word(i, (char *) "lequel", (char *) "lequel", (char *) "PRQ", (char *) "PRQ", (char *) "NULL", 0, (char *) "PRQ"); conll_add_word(s, w2, i+1, dep1); } } @@ -334,9 +334,9 @@ void traite_amalgame_auxquels(conll_sentence *s, int i) w = s->words[i]; if((w->mother) && (w->daughters_nb > 0)){ dep1 = w->daughters[0]; - strcpy(w->form, "à"); - strcpy(w->lemma, "à"); - w2 = conll_allocate_word(i, "lesquels", "lequel", "PRQ", "PRQ", "NULL", 0, "PRQ"); + strcpy(w->form, (char *) "à"); + strcpy(w->lemma, (char *) "à"); + w2 = conll_allocate_word(i, (char *) "lesquels", (char *) "lequel", (char *) "PRQ", (char *) "PRQ", (char *) "NULL", 0, (char *) "PRQ"); conll_add_word(s, w2, i+1, dep1); } } @@ -347,9 +347,9 @@ void traite_amalgame_auxquelles(conll_sentence *s, int i) w = s->words[i]; if((w->mother) && (w->daughters_nb > 0)){ dep1 = w->daughters[0]; - strcpy(w->form, "à"); - strcpy(w->lemma, "à"); - w2 = conll_allocate_word(i, "lesquelles", "lequel", "PRQ", "PRQ", "NULL", 0, "PRQ"); + strcpy(w->form, (char *) "à"); + strcpy(w->lemma, (char *) "à"); + w2 = conll_allocate_word(i, (char *) "lesquelles", (char *) "lequel", (char *) "PRQ", (char *) "PRQ", (char *) "NULL", 0, (char *) "PRQ"); conll_add_word(s, w2, i+1, dep1); } } @@ -360,9 +360,9 @@ void traite_amalgame_duquel(conll_sentence *s, int i) w = s->words[i]; if((w->mother) && (w->daughters_nb > 0)){ dep1 = w->daughters[0]; - strcpy(w->form, "de"); - strcpy(w->lemma, "de"); - w2 = conll_allocate_word(i, "lequel", "lequel", "PRQ", "PRQ", "NULL", 0, "PRQ"); + strcpy(w->form, (char *) "de"); + strcpy(w->lemma, (char *) "de"); + w2 = conll_allocate_word(i, (char *) "lequel", (char *) "lequel", (char *) "PRQ", (char *) "PRQ", (char *) "NULL", 0, (char *) "PRQ"); conll_add_word(s, w2, i+1, dep1); } } @@ -373,9 +373,9 @@ void traite_amalgame_desquels(conll_sentence *s, int i) w = s->words[i]; if((w->mother) && (w->daughters_nb > 0)){ dep1 = w->daughters[0]; - strcpy(w->form, "de"); - strcpy(w->lemma, "de"); - w2 = conll_allocate_word(i, "lesquels", "lequel", "PRQ", "PRQ", "NULL", 0, "PRQ"); + strcpy(w->form, (char *) "de"); + strcpy(w->lemma, (char *) "de"); + w2 = conll_allocate_word(i, (char *) "lesquels", (char *) "lequel", (char *) "PRQ", (char *) "PRQ", (char *) "NULL", 0, (char *) "PRQ"); conll_add_word(s, w2, i+1, dep1); } } @@ -386,32 +386,32 @@ void traite_amalgame_desquelles(conll_sentence *s, int i) w = s->words[i]; if((w->mother) && (w->daughters_nb > 0)){ dep1 = w->daughters[0]; - strcpy(w->form, "de"); - strcpy(w->lemma, "de"); - w2 = conll_allocate_word(i, "lesquelles", "lequel", "PRQ", "PRQ", "NULL", 0, "PRQ"); + strcpy(w->form, (char *) "de"); + strcpy(w->lemma, (char *) "de"); + w2 = conll_allocate_word(i, (char *) "lesquelles", (char *) "lequel", (char *) "PRQ", (char *) "PRQ", (char *) "NULL", 0, (char *) "PRQ"); conll_add_word(s, w2, i+1, dep1); } } void orfeo_traite_amalgames(conll_sentence *s) { - int i; + unsigned i; conll_word *w; for(i=1; i<s->l; i++){ /* printf("************ l = %d\n", s->l); printf("************ i = %d form = %s\n", i, w->form);*/ w = s->words[i]; - if(!strcmp(w->form, "du")) traite_amalgame_du(s, i); - else if(!strcmp(w->form, "des")) traite_amalgame_des(s, i); - else if(!strcmp(w->form, "au")) traite_amalgame_au(s, i); - else if(!strcmp(w->form, "aux")) traite_amalgame_aux(s, i); - else if(!strcmp(w->form, "auquel")) traite_amalgame_auquel(s, i); - else if(!strcmp(w->form, "auxquels")) traite_amalgame_auxquels(s, i); - else if(!strcmp(w->form, "auxquelles")) traite_amalgame_auxquelles(s, i); - else if(!strcmp(w->form, "duquel")) traite_amalgame_duquel(s, i); - else if(!strcmp(w->form, "desquels")) traite_amalgame_desquels(s, i); - else if(!strcmp(w->form, "desquelles")) traite_amalgame_desquelles(s, i); + if(!strcmp(w->form, (char *) "du")) traite_amalgame_du(s, i); + else if(!strcmp(w->form, (char *) "des")) traite_amalgame_des(s, i); + else if(!strcmp(w->form, (char *) "au")) traite_amalgame_au(s, i); + else if(!strcmp(w->form, (char *) "aux")) traite_amalgame_aux(s, i); + else if(!strcmp(w->form, (char *) "auquel")) traite_amalgame_auquel(s, i); + else if(!strcmp(w->form, (char *) "auxquels")) traite_amalgame_auxquels(s, i); + else if(!strcmp(w->form, (char *) "auxquelles")) traite_amalgame_auxquelles(s, i); + else if(!strcmp(w->form, (char *) "duquel")) traite_amalgame_duquel(s, i); + else if(!strcmp(w->form, (char *) "desquels")) traite_amalgame_desquels(s, i); + else if(!strcmp(w->form, (char *) "desquelles")) traite_amalgame_desquelles(s, i); } -- GitLab