diff --git a/maca_lemmatizer/src/context.c b/maca_lemmatizer/src/context.c index 3ba024477c1376898047ca1e91da20470ec6465a..514fcd040e2d7f6cb2f865455f4822e236a69640 100644 --- a/maca_lemmatizer/src/context.c +++ b/maca_lemmatizer/src/context.c @@ -7,8 +7,6 @@ #include "util.h" -#define STANDARD_FPLM_FILENAME "fplm" - void context_set_linguistic_resources_filenames(context *ctx); void context_free(context *ctx) @@ -142,7 +140,7 @@ void context_set_linguistic_resources_filenames(context *ctx) if(!ctx->fplm_filename){ strcpy(absolute_filename, absolute_path); - strcat(absolute_filename, STANDARD_FPLM_FILENAME); + strcat(absolute_filename, DEFAULT_FPLM_FILENAME); ctx->fplm_filename = strdup(absolute_filename); } diff --git a/maca_lemmatizer/src/context.h b/maca_lemmatizer/src/context.h index 5352eb3f71cebaf88b5c571a81ae7051816d207c..83c607104947882237e02b92275669c76e812657 100644 --- a/maca_lemmatizer/src/context.h +++ b/maca_lemmatizer/src/context.h @@ -4,6 +4,10 @@ #include "mcd.h" #include <stdlib.h> +#define DEFAULT_FPLM_FILENAME "fplm" + + + typedef struct { int help; int verbose; @@ -17,6 +21,8 @@ typedef struct { mcd *mcd_struct; } context; + + context *context_new(void); void context_free(context *ctx); @@ -24,6 +30,7 @@ context *context_read_options(int argc, char *argv[]); void context_general_help_message(context *ctx); void context_conll_help_message(context *ctx); void context_language_help_message(context *ctx); +void context_fplm_help_message(context *ctx); void context_maca_data_path_help_message(context *ctx); void context_mcd_help_message(context *ctx); diff --git a/maca_trans_parser/src/beam.c b/maca_trans_parser/src/beam.c index f0ba3ceed673bcfbcb48a75f077d5801259eed7e..ecfc0ea05b75ea0f1aa2186dd532e23473e34a70 100644 --- a/maca_trans_parser/src/beam.c +++ b/maca_trans_parser/src/beam.c @@ -176,8 +176,6 @@ config *beam_decoder_sentence(config *initial_config, dico *dico_features, featu beam *next_beam= beam_new(beam_width); beam *final_beam= beam_new(beam_width); beam *tmp_beam= NULL; - int i; - float max; config *argmax; int step = 0; diff --git a/maca_trans_parser/src/context.c b/maca_trans_parser/src/context.c index b39cafb1a3f01d51aaccbf1e460b2bc3c8154923..21223ad89edaf5ec867cc34e6096cb5c98af0b22 100644 --- a/maca_trans_parser/src/context.c +++ b/maca_trans_parser/src/context.c @@ -314,25 +314,25 @@ void context_set_linguistic_resources_filenames(context *ctx) if(!ctx->perc_model_filename){ strcpy(absolute_filename, absolute_path); - strcat(absolute_filename, STANDARD_MODEL_FILENAME); + strcat(absolute_filename, DEFAULT_MODEL_FILENAME); ctx->perc_model_filename = strdup(absolute_filename); } if(!ctx->vocabs_filename){ strcpy(absolute_filename, absolute_path); - strcat(absolute_filename, STANDARD_VOCABS_FILENAME); + strcat(absolute_filename, DEFAULT_VOCABS_FILENAME); ctx->vocabs_filename = strdup(absolute_filename); } /* if(!ctx->mcd_filename){ strcpy(absolute_filename, absolute_path); - strcat(absolute_filename, STANDARD_MULTI_COL_DESC_FILENAME); + strcat(absolute_filename, DEFAULT_MULTI_COL_DESC_FILENAME); ctx->mcd_filename = strdup(absolute_filename); }*/ if(!ctx->features_model_filename){ strcpy(absolute_filename, absolute_path); - strcat(absolute_filename, STANDARD_FEATURES_MODEL_FILENAME); + strcat(absolute_filename, DEFAULT_FEATURES_MODEL_FILENAME); ctx->features_model_filename = strdup(absolute_filename); } diff --git a/maca_trans_parser/src/context.h b/maca_trans_parser/src/context.h index cab2a216c7284e863306f8d8e6a82fd94b3b8a7c..222f8ad31a978ad60623f56e99fbd57545ecf46d 100644 --- a/maca_trans_parser/src/context.h +++ b/maca_trans_parser/src/context.h @@ -4,10 +4,10 @@ #define TEST_MODE 1 #define TRAIN_MODE 2 -#define STANDARD_MULTI_COL_DESC_FILENAME "maca_trans_parser.mcd" -#define STANDARD_FEATURES_MODEL_FILENAME "maca_trans_parser.fm" -#define STANDARD_VOCABS_FILENAME "maca_trans_parser.vocab" -#define STANDARD_MODEL_FILENAME "maca_trans_parser.model" +#define DEFAULT_MULTI_COL_DESC_FILENAME "maca_trans_parser.mcd" +#define DEFAULT_FEATURES_MODEL_FILENAME "maca_trans_parser.fm" +#define DEFAULT_VOCABS_FILENAME "maca_trans_parser.vocab" +#define DEFAULT_MODEL_FILENAME "maca_trans_parser.model" #include "dico_vec.h" #include "feat_model.h" diff --git a/maca_trans_parser/src/depset.c b/maca_trans_parser/src/depset.c index 11f5ef8069c0d1c228e0c9fb0ab05ef1a9c039a5..c69c3122205ffee7c790b1ac646e002d6600ad8d 100644 --- a/maca_trans_parser/src/depset.c +++ b/maca_trans_parser/src/depset.c @@ -90,6 +90,7 @@ char *skip_index(char *buffer) if(buffer[i] < '0' || buffer[i] > '9' || buffer[i] == ' ' || buffer[i] == '\t') return &buffer[i]; } + return NULL; } void depset_print_new_index(FILE *f, depset *d, dico *dico_labels) diff --git a/maca_trans_parser/src/feat_fct.c b/maca_trans_parser/src/feat_fct.c index 515116268b355db60d85ff90708e10deda35da62..190ba38f5000627f917b771e4c2c74827b312ba4 100644 --- a/maca_trans_parser/src/feat_fct.c +++ b/maca_trans_parser/src/feat_fct.c @@ -1,282 +1,282 @@ #include<stdio.h> #include<stdlib.h> #include<string.h> +#include"stack.h" #include"feat_fct.h" #include"feat_types.h" /* word features */ -int s0f(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_FORM];} -int s0l(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_LEMMA];} -int s0c(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_CPOS];} -int s0p(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_POS];} -int s0m(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_FEATS];} -int s0s(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_STAG];} -int s0A(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_A];} -int s0B(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_B];} -int s0C(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_C];} -int s0D(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_D];} -int s0E(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_E];} -int s0F(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_F];} -int s0G(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_G];} -int s0H(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_H];} -int s0I(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_I];} -int s0J(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_J];} -int s0K(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_K];} -int s0L(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_L];} -int s0M(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_M];} -int s0N(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_N];} -int s0O(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_O];} -int s0P(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_P];} -int s0Q(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_Q];} -int s0R(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_R];} -int s0S(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_S];} -int s0T(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_T];} -int s0U(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_U];} -int s0V(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_V];} -int s0W(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_W];} -int s0X(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_X];} -int s0Y(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_Y];} -int s0Z(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->feat_array[FEAT_TYPE_Z];} - -int s0U1(config *c) {return (c->st->top < 1) ? -1 : c->st->array[c->st->top - 1]->U1;} - -int s1f(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_FORM];} -int s1l(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_LEMMA];} -int s1c(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_CPOS];} -int s1p(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_POS];} -int s1m(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_FEATS];} -int s1s(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_STAG];} -int s1A(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_A];} -int s1B(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_B];} -int s1C(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_C];} -int s1D(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_D];} -int s1E(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_E];} -int s1F(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_F];} -int s1G(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_G];} -int s1H(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_H];} -int s1I(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_I];} -int s1J(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_J];} -int s1K(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_K];} -int s1L(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_L];} -int s1M(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_M];} -int s1N(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_N];} -int s1O(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_O];} -int s1P(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_P];} -int s1Q(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_Q];} -int s1R(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_R];} -int s1S(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_S];} -int s1T(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_T];} -int s1U(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_U];} -int s1V(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_V];} -int s1W(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_W];} -int s1X(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_X];} -int s1Y(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_Y];} -int s1Z(config *c) {return (c->st->top < 2) ? -1 : c->st->array[c->st->top - 2]->feat_array[FEAT_TYPE_Z];} - -int s2f(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_FORM];} -int s2l(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_LEMMA];} -int s2c(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_CPOS];} -int s2p(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_POS];} -int s2m(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_FEATS];} -int s2s(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_STAG];} -int s2A(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_A];} -int s2B(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_B];} -int s2C(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_C];} -int s2D(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_D];} -int s2E(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_E];} -int s2F(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_F];} -int s2G(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_G];} -int s2H(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_H];} -int s2I(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_I];} -int s2J(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_J];} -int s2K(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_K];} -int s2L(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_L];} -int s2M(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_M];} -int s2N(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_N];} -int s2O(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_O];} -int s2P(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_P];} -int s2Q(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_Q];} -int s2R(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_R];} -int s2S(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_S];} -int s2T(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_T];} -int s2U(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_U];} -int s2V(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_V];} -int s2W(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_W];} -int s2X(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_X];} -int s2Y(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_Y];} -int s2Z(config *c) {return (c->st->top < 3) ? -1 : c->st->array[c->st->top - 3]->feat_array[FEAT_TYPE_Z];} - -int s3f(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_FORM];} -int s3l(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_LEMMA];} -int s3c(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_CPOS];} -int s3p(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_POS];} -int s3m(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_FEATS];} -int s3s(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_STAG];} -int s3A(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_A];} -int s3B(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_B];} -int s3C(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_C];} -int s3D(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_D];} -int s3E(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_E];} -int s3F(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_F];} -int s3G(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_G];} -int s3H(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_H];} -int s3I(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_I];} -int s3J(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_J];} -int s3K(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_K];} -int s3L(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_L];} -int s3M(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_M];} -int s3N(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_N];} -int s3O(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_O];} -int s3P(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_P];} -int s3Q(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_Q];} -int s3R(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_R];} -int s3S(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_S];} -int s3T(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_T];} -int s3U(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_U];} -int s3V(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_V];} -int s3W(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_W];} -int s3X(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_X];} -int s3Y(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_Y];} -int s3Z(config *c) {return (c->st->top < 4) ? -1 : c->st->array[c->st->top - 4]->feat_array[FEAT_TYPE_Z];} - -int b0f(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_FORM];} -int b0l(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_LEMMA];} -int b0c(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_CPOS];} -int b0p(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_POS];} -int b0m(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_FEATS];} -int b0s(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_STAG];} -int b0A(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_A];} -int b0B(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_B];} -int b0C(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_C];} -int b0D(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_D];} -int b0E(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_E];} -int b0F(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_F];} -int b0G(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_G];} -int b0H(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_H];} -int b0I(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_I];} -int b0J(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_J];} -int b0K(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_K];} -int b0L(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_L];} -int b0M(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_M];} -int b0N(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_N];} -int b0O(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_O];} -int b0P(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_P];} -int b0Q(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_Q];} -int b0R(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_R];} -int b0S(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_S];} -int b0T(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_T];} -int b0U(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_U];} -int b0V(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_V];} -int b0W(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_W];} -int b0X(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_X];} -int b0Y(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_Y];} -int b0Z(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->feat_array[FEAT_TYPE_Z];} - -int b0U1(config *c) {return (c->bf->nbelem < 1) ? -1 : queue_elt_n(c->bf, 0)->U1;} - - -int b1f(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_FORM];} -int b1l(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_LEMMA];} -int b1c(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_CPOS];} -int b1p(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_POS];} -int b1m(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_FEATS];} -int b1s(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_STAG];} -int b1A(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_A];} -int b1B(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_B];} -int b1C(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_C];} -int b1D(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_D];} -int b1E(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_E];} -int b1F(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_F];} -int b1G(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_G];} -int b1H(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_H];} -int b1I(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_I];} -int b1J(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_J];} -int b1K(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_K];} -int b1L(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_L];} -int b1M(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_M];} -int b1N(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_N];} -int b1O(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_O];} -int b1P(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_P];} -int b1Q(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_Q];} -int b1R(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_R];} -int b1S(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_S];} -int b1T(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_T];} -int b1U(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_U];} -int b1V(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_V];} -int b1W(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_W];} -int b1X(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_X];} -int b1Y(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_Y];} -int b1Z(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->feat_array[FEAT_TYPE_Z];} - -int b1U1(config *c) {return (c->bf->nbelem < 2) ? -1 : queue_elt_n(c->bf, 1)->U1;} - - -int b2f(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_FORM];} -int b2l(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_LEMMA];} -int b2c(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_CPOS];} -int b2p(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_POS];} -int b2m(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_FEATS];} -int b2s(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_STAG];} -int b2A(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_A];} -int b2B(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_B];} -int b2C(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_C];} -int b2D(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_D];} -int b2E(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_E];} -int b2F(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_F];} -int b2G(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_G];} -int b2H(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_H];} -int b2I(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_I];} -int b2J(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_J];} -int b2K(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_K];} -int b2L(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_L];} -int b2M(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_M];} -int b2N(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_N];} -int b2O(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_O];} -int b2P(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_P];} -int b2Q(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_Q];} -int b2R(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_R];} -int b2S(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_S];} -int b2T(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_T];} -int b2U(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_U];} -int b2V(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_V];} -int b2W(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_W];} -int b2X(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_X];} -int b2Y(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_Y];} -int b2Z(config *c) {return (c->bf->nbelem < 3) ? -1 : queue_elt_n(c->bf, 2)->feat_array[FEAT_TYPE_Z];} - -int b3f(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_FORM];} -int b3l(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_LEMMA];} -int b3c(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_CPOS];} -int b3p(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_POS];} -int b3m(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_FEATS];} -int b3s(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_STAG];} -int b3A(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_A];} -int b3B(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_B];} -int b3C(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_C];} -int b3D(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_D];} -int b3E(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_E];} -int b3F(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_F];} -int b3G(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_G];} -int b3H(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_H];} -int b3I(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_I];} -int b3J(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_J];} -int b3K(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_K];} -int b3L(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_L];} -int b3M(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_M];} -int b3N(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_N];} -int b3O(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_O];} -int b3P(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_P];} -int b3Q(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_Q];} -int b3R(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_R];} -int b3S(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_S];} -int b3T(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_T];} -int b3U(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_U];} -int b3V(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_V];} -int b3W(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_W];} -int b3X(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_X];} -int b3Y(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_Y];} -int b3Z(config *c) {return (c->bf->nbelem < 4) ? -1 : queue_elt_n(c->bf, 3)->feat_array[FEAT_TYPE_Z];} +int s0f(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_form(stack_elt_n(c->st, 0));} +int s0l(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_lemma(stack_elt_n(c->st, 0));} +int s0c(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_cpos(stack_elt_n(c->st, 0));} +int s0p(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_pos(stack_elt_n(c->st, 0));} +int s0m(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_feats(stack_elt_n(c->st, 0));} +int s0s(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_stag(stack_elt_n(c->st, 0));} +int s0A(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_A(stack_elt_n(c->st, 0));} +int s0B(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_B(stack_elt_n(c->st, 0));} +int s0C(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_C(stack_elt_n(c->st, 0));} +int s0D(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_D(stack_elt_n(c->st, 0));} +int s0E(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_E(stack_elt_n(c->st, 0));} +int s0F(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_F(stack_elt_n(c->st, 0));} +int s0G(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_G(stack_elt_n(c->st, 0));} +int s0H(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_H(stack_elt_n(c->st, 0));} +int s0I(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_I(stack_elt_n(c->st, 0));} +int s0J(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_J(stack_elt_n(c->st, 0));} +int s0K(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_K(stack_elt_n(c->st, 0));} +int s0L(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_L(stack_elt_n(c->st, 0));} +int s0M(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_M(stack_elt_n(c->st, 0));} +int s0N(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_N(stack_elt_n(c->st, 0));} +int s0O(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_O(stack_elt_n(c->st, 0));} +int s0P(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_P(stack_elt_n(c->st, 0));} +int s0Q(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_Q(stack_elt_n(c->st, 0));} +int s0R(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_R(stack_elt_n(c->st, 0));} +int s0S(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_S(stack_elt_n(c->st, 0));} +int s0T(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_T(stack_elt_n(c->st, 0));} +int s0U(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_U(stack_elt_n(c->st, 0));} +int s0V(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_V(stack_elt_n(c->st, 0));} +int s0W(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_W(stack_elt_n(c->st, 0));} +int s0X(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_X(stack_elt_n(c->st, 0));} +int s0Y(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_Y(stack_elt_n(c->st, 0));} +int s0Z(config *c) {return (stack_height(c->st) < 1) ? -1 : word_get_Z(stack_elt_n(c->st, 0));} + +int s0U1(config *c) {return (stack_height(c->st) < 1) ? -1 : stack_elt_n(c->st, 0)->U1;} + +int s1f(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_form(stack_elt_n(c->st, 1));} +int s1l(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_lemma(stack_elt_n(c->st, 1));} +int s1c(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_cpos(stack_elt_n(c->st, 1));} +int s1p(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_pos(stack_elt_n(c->st, 1));} +int s1m(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_feats(stack_elt_n(c->st, 1));} +int s1s(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_stag(stack_elt_n(c->st, 1));} +int s1A(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_A(stack_elt_n(c->st, 1));} +int s1B(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_B(stack_elt_n(c->st, 1));} +int s1C(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_C(stack_elt_n(c->st, 1));} +int s1D(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_D(stack_elt_n(c->st, 1));} +int s1E(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_E(stack_elt_n(c->st, 1));} +int s1F(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_F(stack_elt_n(c->st, 1));} +int s1G(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_G(stack_elt_n(c->st, 1));} +int s1H(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_H(stack_elt_n(c->st, 1));} +int s1I(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_I(stack_elt_n(c->st, 1));} +int s1J(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_J(stack_elt_n(c->st, 1));} +int s1K(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_K(stack_elt_n(c->st, 1));} +int s1L(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_L(stack_elt_n(c->st, 1));} +int s1M(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_M(stack_elt_n(c->st, 1));} +int s1N(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_N(stack_elt_n(c->st, 1));} +int s1O(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_O(stack_elt_n(c->st, 1));} +int s1P(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_P(stack_elt_n(c->st, 1));} +int s1Q(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_Q(stack_elt_n(c->st, 1));} +int s1R(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_R(stack_elt_n(c->st, 1));} +int s1S(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_S(stack_elt_n(c->st, 1));} +int s1T(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_T(stack_elt_n(c->st, 1));} +int s1U(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_U(stack_elt_n(c->st, 1));} +int s1V(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_V(stack_elt_n(c->st, 1));} +int s1W(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_W(stack_elt_n(c->st, 1));} +int s1X(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_X(stack_elt_n(c->st, 1));} +int s1Y(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_Y(stack_elt_n(c->st, 1));} +int s1Z(config *c) {return (stack_height(c->st) < 2) ? -1 : word_get_Z(stack_elt_n(c->st, 1));} + +int s2f(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_form(stack_elt_n(c->st, 2));} +int s2l(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_lemma(stack_elt_n(c->st, 2));} +int s2c(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_cpos(stack_elt_n(c->st, 2));} +int s2p(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_pos(stack_elt_n(c->st, 2));} +int s2m(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_feats(stack_elt_n(c->st, 2));} +int s2s(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_stag(stack_elt_n(c->st, 2));} +int s2A(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_A(stack_elt_n(c->st, 2));} +int s2B(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_B(stack_elt_n(c->st, 2));} +int s2C(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_C(stack_elt_n(c->st, 2));} +int s2D(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_D(stack_elt_n(c->st, 2));} +int s2E(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_E(stack_elt_n(c->st, 2));} +int s2F(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_F(stack_elt_n(c->st, 2));} +int s2G(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_G(stack_elt_n(c->st, 2));} +int s2H(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_H(stack_elt_n(c->st, 2));} +int s2I(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_I(stack_elt_n(c->st, 2));} +int s2J(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_J(stack_elt_n(c->st, 2));} +int s2K(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_K(stack_elt_n(c->st, 2));} +int s2L(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_L(stack_elt_n(c->st, 2));} +int s2M(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_M(stack_elt_n(c->st, 2));} +int s2N(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_N(stack_elt_n(c->st, 2));} +int s2O(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_O(stack_elt_n(c->st, 2));} +int s2P(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_P(stack_elt_n(c->st, 2));} +int s2Q(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_Q(stack_elt_n(c->st, 2));} +int s2R(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_R(stack_elt_n(c->st, 2));} +int s2S(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_S(stack_elt_n(c->st, 2));} +int s2T(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_T(stack_elt_n(c->st, 2));} +int s2U(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_U(stack_elt_n(c->st, 2));} +int s2V(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_V(stack_elt_n(c->st, 2));} +int s2W(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_W(stack_elt_n(c->st, 2));} +int s2X(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_X(stack_elt_n(c->st, 2));} +int s2Y(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_Y(stack_elt_n(c->st, 2));} +int s2Z(config *c) {return (stack_height(c->st) < 3) ? -1 : word_get_Z(stack_elt_n(c->st, 2));} + +int s3f(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_form(stack_elt_n(c->st, 3));} +int s3l(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_lemma(stack_elt_n(c->st, 3));} +int s3c(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_cpos(stack_elt_n(c->st, 3));} +int s3p(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_pos(stack_elt_n(c->st, 3));} +int s3m(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_feats(stack_elt_n(c->st, 3));} +int s3s(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_stag(stack_elt_n(c->st, 3));} +int s3A(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_A(stack_elt_n(c->st, 3));} +int s3B(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_B(stack_elt_n(c->st, 3));} +int s3C(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_C(stack_elt_n(c->st, 3));} +int s3D(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_D(stack_elt_n(c->st, 3));} +int s3E(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_E(stack_elt_n(c->st, 3));} +int s3F(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_F(stack_elt_n(c->st, 3));} +int s3G(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_G(stack_elt_n(c->st, 3));} +int s3H(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_H(stack_elt_n(c->st, 3));} +int s3I(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_I(stack_elt_n(c->st, 3));} +int s3J(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_J(stack_elt_n(c->st, 3));} +int s3K(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_K(stack_elt_n(c->st, 3));} +int s3L(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_L(stack_elt_n(c->st, 3));} +int s3M(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_M(stack_elt_n(c->st, 3));} +int s3N(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_N(stack_elt_n(c->st, 3));} +int s3O(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_O(stack_elt_n(c->st, 3));} +int s3P(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_P(stack_elt_n(c->st, 3));} +int s3Q(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_Q(stack_elt_n(c->st, 3));} +int s3R(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_R(stack_elt_n(c->st, 3));} +int s3S(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_S(stack_elt_n(c->st, 3));} +int s3T(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_T(stack_elt_n(c->st, 3));} +int s3U(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_U(stack_elt_n(c->st, 3));} +int s3V(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_V(stack_elt_n(c->st, 3));} +int s3W(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_W(stack_elt_n(c->st, 3));} +int s3X(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_X(stack_elt_n(c->st, 3));} +int s3Y(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_Y(stack_elt_n(c->st, 3));} +int s3Z(config *c) {return (stack_height(c->st) < 4) ? -1 : word_get_Z(stack_elt_n(c->st, 3));} + +int b0f(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_form(queue_elt_n(c->bf, 0));} +int b0l(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_lemma(queue_elt_n(c->bf, 0));} +int b0c(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_cpos(queue_elt_n(c->bf, 0));} +int b0p(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_pos(queue_elt_n(c->bf, 0));} +int b0m(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_feats(queue_elt_n(c->bf, 0));} +int b0s(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_stag(queue_elt_n(c->bf, 0));} +int b0A(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_A(queue_elt_n(c->bf, 0));} +int b0B(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_B(queue_elt_n(c->bf, 0));} +int b0C(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_C(queue_elt_n(c->bf, 0));} +int b0D(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_D(queue_elt_n(c->bf, 0));} +int b0E(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_E(queue_elt_n(c->bf, 0));} +int b0F(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_F(queue_elt_n(c->bf, 0));} +int b0G(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_G(queue_elt_n(c->bf, 0));} +int b0H(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_H(queue_elt_n(c->bf, 0));} +int b0I(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_I(queue_elt_n(c->bf, 0));} +int b0J(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_J(queue_elt_n(c->bf, 0));} +int b0K(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_K(queue_elt_n(c->bf, 0));} +int b0L(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_L(queue_elt_n(c->bf, 0));} +int b0M(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_M(queue_elt_n(c->bf, 0));} +int b0N(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_N(queue_elt_n(c->bf, 0));} +int b0O(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_O(queue_elt_n(c->bf, 0));} +int b0P(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_P(queue_elt_n(c->bf, 0));} +int b0Q(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_Q(queue_elt_n(c->bf, 0));} +int b0R(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_R(queue_elt_n(c->bf, 0));} +int b0S(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_S(queue_elt_n(c->bf, 0));} +int b0T(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_T(queue_elt_n(c->bf, 0));} +int b0U(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_U(queue_elt_n(c->bf, 0));} +int b0V(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_V(queue_elt_n(c->bf, 0));} +int b0W(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_W(queue_elt_n(c->bf, 0));} +int b0X(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_X(queue_elt_n(c->bf, 0));} +int b0Y(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_Y(queue_elt_n(c->bf, 0));} +int b0Z(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : word_get_Z(queue_elt_n(c->bf, 0));} + +int b0U1(config *c) {return (queue_nbelem(c->bf) < 1) ? -1 : queue_elt_n(c->bf, 0)->U1;} + + +int b1f(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_form(queue_elt_n(c->bf, 1));} +int b1l(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_lemma(queue_elt_n(c->bf, 1));} +int b1c(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_cpos(queue_elt_n(c->bf, 1));} +int b1p(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_pos(queue_elt_n(c->bf, 1));} +int b1m(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_feats(queue_elt_n(c->bf, 1));} +int b1s(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_stag(queue_elt_n(c->bf, 1));} +int b1A(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_A(queue_elt_n(c->bf, 1));} +int b1B(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_B(queue_elt_n(c->bf, 1));} +int b1C(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_C(queue_elt_n(c->bf, 1));} +int b1D(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_D(queue_elt_n(c->bf, 1));} +int b1E(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_E(queue_elt_n(c->bf, 1));} +int b1F(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_F(queue_elt_n(c->bf, 1));} +int b1G(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_G(queue_elt_n(c->bf, 1));} +int b1H(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_H(queue_elt_n(c->bf, 1));} +int b1I(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_I(queue_elt_n(c->bf, 1));} +int b1J(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_J(queue_elt_n(c->bf, 1));} +int b1K(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_K(queue_elt_n(c->bf, 1));} +int b1L(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_L(queue_elt_n(c->bf, 1));} +int b1M(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_M(queue_elt_n(c->bf, 1));} +int b1N(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_N(queue_elt_n(c->bf, 1));} +int b1O(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_O(queue_elt_n(c->bf, 1));} +int b1P(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_P(queue_elt_n(c->bf, 1));} +int b1Q(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_Q(queue_elt_n(c->bf, 1));} +int b1R(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_R(queue_elt_n(c->bf, 1));} +int b1S(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_S(queue_elt_n(c->bf, 1));} +int b1T(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_T(queue_elt_n(c->bf, 1));} +int b1U(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_U(queue_elt_n(c->bf, 1));} +int b1V(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_V(queue_elt_n(c->bf, 1));} +int b1W(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_W(queue_elt_n(c->bf, 1));} +int b1X(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_X(queue_elt_n(c->bf, 1));} +int b1Y(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_Y(queue_elt_n(c->bf, 1));} +int b1Z(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : word_get_Z(queue_elt_n(c->bf, 1));} + +int b1U1(config *c) {return (queue_nbelem(c->bf) < 2) ? -1 : queue_elt_n(c->bf, 1)->U1;} + +int b2f(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_form(queue_elt_n(c->bf, 2));} +int b2l(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_lemma(queue_elt_n(c->bf, 2));} +int b2c(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_cpos(queue_elt_n(c->bf, 2));} +int b2p(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_pos(queue_elt_n(c->bf, 2));} +int b2m(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_feats(queue_elt_n(c->bf, 2));} +int b2s(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_stag(queue_elt_n(c->bf, 2));} +int b2A(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_A(queue_elt_n(c->bf, 2));} +int b2B(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_B(queue_elt_n(c->bf, 2));} +int b2C(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_C(queue_elt_n(c->bf, 2));} +int b2D(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_D(queue_elt_n(c->bf, 2));} +int b2E(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_E(queue_elt_n(c->bf, 2));} +int b2F(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_F(queue_elt_n(c->bf, 2));} +int b2G(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_G(queue_elt_n(c->bf, 2));} +int b2H(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_H(queue_elt_n(c->bf, 2));} +int b2I(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_I(queue_elt_n(c->bf, 2));} +int b2J(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_J(queue_elt_n(c->bf, 2));} +int b2K(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_K(queue_elt_n(c->bf, 2));} +int b2L(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_L(queue_elt_n(c->bf, 2));} +int b2M(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_M(queue_elt_n(c->bf, 2));} +int b2N(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_N(queue_elt_n(c->bf, 2));} +int b2O(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_O(queue_elt_n(c->bf, 2));} +int b2P(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_P(queue_elt_n(c->bf, 2));} +int b2Q(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_Q(queue_elt_n(c->bf, 2));} +int b2R(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_R(queue_elt_n(c->bf, 2));} +int b2S(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_S(queue_elt_n(c->bf, 2));} +int b2T(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_T(queue_elt_n(c->bf, 2));} +int b2U(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_U(queue_elt_n(c->bf, 2));} +int b2V(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_V(queue_elt_n(c->bf, 2));} +int b2W(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_W(queue_elt_n(c->bf, 2));} +int b2X(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_X(queue_elt_n(c->bf, 2));} +int b2Y(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_Y(queue_elt_n(c->bf, 2));} +int b2Z(config *c) {return (queue_nbelem(c->bf) < 3) ? -1 : word_get_Z(queue_elt_n(c->bf, 2));} + +int b3f(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_form(queue_elt_n(c->bf, 3));} +int b3l(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_lemma(queue_elt_n(c->bf, 3));} +int b3c(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_cpos(queue_elt_n(c->bf, 3));} +int b3p(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_pos(queue_elt_n(c->bf, 3));} +int b3m(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_feats(queue_elt_n(c->bf, 3));} +int b3s(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_stag(queue_elt_n(c->bf, 3));} +int b3A(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_A(queue_elt_n(c->bf, 3));} +int b3B(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_B(queue_elt_n(c->bf, 3));} +int b3C(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_C(queue_elt_n(c->bf, 3));} +int b3D(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_D(queue_elt_n(c->bf, 3));} +int b3E(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_E(queue_elt_n(c->bf, 3));} +int b3F(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_F(queue_elt_n(c->bf, 3));} +int b3G(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_G(queue_elt_n(c->bf, 3));} +int b3H(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_H(queue_elt_n(c->bf, 3));} +int b3I(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_I(queue_elt_n(c->bf, 3));} +int b3J(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_J(queue_elt_n(c->bf, 3));} +int b3K(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_K(queue_elt_n(c->bf, 3));} +int b3L(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_L(queue_elt_n(c->bf, 3));} +int b3M(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_M(queue_elt_n(c->bf, 3));} +int b3N(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_N(queue_elt_n(c->bf, 3));} +int b3O(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_O(queue_elt_n(c->bf, 3));} +int b3P(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_P(queue_elt_n(c->bf, 3));} +int b3Q(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_Q(queue_elt_n(c->bf, 3));} +int b3R(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_R(queue_elt_n(c->bf, 3));} +int b3S(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_S(queue_elt_n(c->bf, 3));} +int b3T(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_T(queue_elt_n(c->bf, 3));} +int b3U(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_U(queue_elt_n(c->bf, 3));} +int b3V(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_V(queue_elt_n(c->bf, 3));} +int b3W(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_W(queue_elt_n(c->bf, 3));} +int b3X(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_X(queue_elt_n(c->bf, 3));} +int b3Y(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_Y(queue_elt_n(c->bf, 3));} +int b3Z(config *c) {return (queue_nbelem(c->bf) < 4) ? -1 : word_get_Z(queue_elt_n(c->bf, 3));} /* structural features */ diff --git a/maca_trans_parser/src/feat_vec.h b/maca_trans_parser/src/feat_vec.h index 9667ef3ede08d2226e6ef9bfbf760f5f3e10d499..4116d7652be8bdf4dd5922f936c40686cf28b67b 100644 --- a/maca_trans_parser/src/feat_vec.h +++ b/maca_trans_parser/src/feat_vec.h @@ -23,7 +23,7 @@ int feat_vec_add(feat_vec *fv, int feat); void feat_vec_empty(feat_vec *fv); void feat_vec_print_string(feat_vec *fv, dico *dico_features); void feat_vec_print(FILE *f, feat_vec *fv); -/* void feat_vec_print_dnn(FILE *f, feat_vec *fv, feat_model *fm, mcd *m); */ +/* void feat_vec_print_dnn(FILE *f, feat_vec *fv, feat_model *fm, mcd *m); */ /* void feat_vec_fill_input_array_dnn(fann_type *input_array, feat_vec *fv, feat_model *fm, mcd *m); */ /* void feat_vec_fill_input_array_dnn(float *input_array, feat_vec *fv, feat_model *fm, mcd *m); */ #endif diff --git a/maca_trans_parser/src/queue.c b/maca_trans_parser/src/queue.c index aaabd655d1f5cd33e5b003f002e995780dd8d710..fe21062f0e370bc0eaefa8558eac178c4a5c728e 100644 --- a/maca_trans_parser/src/queue.c +++ b/maca_trans_parser/src/queue.c @@ -51,11 +51,6 @@ void queue_print(FILE *f, queue *q) fprintf(f, ")\n"); } -int queue_nbelem(queue *q) -{ - return q->nbelem; -} - queue *queue_new(int size) { queue *q = (queue *)memalloc(sizeof(queue)); diff --git a/maca_trans_parser/src/queue.h b/maca_trans_parser/src/queue.h index d93c59ff0ef72239341400ad11c341f0c47801ff..8ecd766a7fb775f86d0a11b3db703c8bec77a650 100644 --- a/maca_trans_parser/src/queue.h +++ b/maca_trans_parser/src/queue.h @@ -5,6 +5,11 @@ #include"word.h" #include"mcd.h" +#define queue_nbelem(q) (q)->nbelem +#define queue_size(q) (q)->size +#define queue_head(q) (q)->head +#define queue_tail(q) (q)->tail + typedef struct { int size; word **array; diff --git a/maca_trans_parser/src/stack.c b/maca_trans_parser/src/stack.c index 988a5825dbfe9399a82f308ce5dc5d2bd9a077ea..2672732f260a5178cd6084ca09ddd3246803f912 100644 --- a/maca_trans_parser/src/stack.c +++ b/maca_trans_parser/src/stack.c @@ -3,6 +3,13 @@ #include"stack.h" #include"util.h" + +/*int stack_height(stack *s) +{ + return(s->top); + }*/ + + int stack_is_empty(stack *s) { return(s->top == 0); diff --git a/maca_trans_parser/src/stack.h b/maca_trans_parser/src/stack.h index 2682011abdf408003343dafd17dc0d6b860be681..4a0a42646ccca69a8d7513eff0a19d9a490be5f9 100644 --- a/maca_trans_parser/src/stack.h +++ b/maca_trans_parser/src/stack.h @@ -4,7 +4,8 @@ #include<stdio.h> #include"word.h" -#define stack_height(s) (s)->top +#define stack_height(s) (s)->top +#define stack_elt_n(s, n) (s)->array[(s)->top - (n) - 1] typedef struct { int size; @@ -20,4 +21,5 @@ word *stack_top(stack *s); void stack_print(FILE *buffer, stack *s); void stack_free(stack *s); int stack_is_empty(stack *s); +/* int stack_height(stack *s); */ #endif diff --git a/maca_trans_parser/src/transform_treebank.c b/maca_trans_parser/src/transform_treebank.c index 7b46049f116e490dc402e47fd4e62279d439e8f6..13a61c5f3f0d697f68e79493a65dc72ec004ab9f 100644 --- a/maca_trans_parser/src/transform_treebank.c +++ b/maca_trans_parser/src/transform_treebank.c @@ -117,7 +117,7 @@ int generate_training_file_stream(FILE *output_file, context *ctx) feat_vec_print(output_file, fv); } else if(ctx->fann_filename){ - feat_vec_print_dnn(output_file, fv, ctx->features_model, ctx->mcd_struct); + /* feat_vec_print_dnn(output_file, fv, ctx->features_model, ctx->mcd_struct); */ print_mvt_fann(output_file, ctx->mvt_nb, mvt_code); fprintf(output_file, "\n\n"); } @@ -218,7 +218,7 @@ int generate_training_file_buffer(FILE *output_file, context *ctx) c = config_initial(conll_file, ctx->mcd_struct, 1000, 0); while((ref = sentence_read(conll_file_ref, ctx->mcd_struct)) && (sentence_nb < ctx->sent_nb)){ - /* sentence_print(stdout, ref, NULL); */ + /* sentence_print(stdout, ref, NULL); */ queue_read_sentence(c->bf, conll_file, ctx->mcd_struct); while(!config_is_terminal(c)){ /* config_print(stdout,c); */