From 1085378cc9b132f7674b4eb730afa6dd0f0816bb Mon Sep 17 00:00:00 2001 From: Alexis Nasr <alexis.nasr@lif.univ-mrs.fr> Date: Sun, 7 Aug 2016 12:06:02 -0400 Subject: [PATCH] modified decode_forrest.c and simple_decoder_forrest.c so that it does not load a model --- maca_trans_parser/src/context.c | 2 +- maca_trans_parser/src/decode_forrest.c | 8 +++----- maca_trans_parser/src/maca_trans_parser_conll2fann.c | 11 ++++++----- maca_trans_parser/src/simple_decoder_forrest.c | 3 ++- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/maca_trans_parser/src/context.c b/maca_trans_parser/src/context.c index 6f7f226..125796d 100644 --- a/maca_trans_parser/src/context.c +++ b/maca_trans_parser/src/context.c @@ -99,7 +99,7 @@ void context_model_help_message(context *ctx){ fprintf(stderr, "\t-m --model <file> : model file name\n"); } void context_input_help_message(context *ctx){ - fprintf(stderr, "\t-i --input <file> : input file name\n"); + fprintf(stderr, "\t-i --input <file> : input file name (default is stdin)\n"); } void context_iterations_help_message(context *ctx){ fprintf(stderr, "\t-n --iter <int> : number of iterations (default is 4)\n"); diff --git a/maca_trans_parser/src/decode_forrest.c b/maca_trans_parser/src/decode_forrest.c index c29a7fe..1371c04 100644 --- a/maca_trans_parser/src/decode_forrest.c +++ b/maca_trans_parser/src/decode_forrest.c @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) ctx = context_read_options(argc, argv); decode_check_options(ctx); - set_linguistic_resources_filenames_parser(ctx); + /* set_linguistic_resources_filenames_parser(ctx); */ ctx->features_model = feat_model_read(ctx->features_model_filename, ctx->verbose); ctx->vocabs = dico_vec_read(ctx->vocabs_filename, ctx->hash_ratio); mcd_link_to_dico(ctx->mcd_struct, ctx->vocabs, ctx->verbose); @@ -112,11 +112,9 @@ int main(int argc, char *argv[]) /* load models */ - ctx->d_perceptron_features = dico_vec_get_dico(ctx->vocabs, (char *)"d_perceptron_features"); + /* ctx->d_perceptron_features = dico_vec_get_dico(ctx->vocabs, (char *)"d_perceptron_features"); */ - if(ctx->beam_width == 1){ - simple_decoder_forrest(ctx); - } + simple_decoder_forrest(ctx); context_free(ctx); return 0; diff --git a/maca_trans_parser/src/maca_trans_parser_conll2fann.c b/maca_trans_parser/src/maca_trans_parser_conll2fann.c index ca3f961..d71feea 100644 --- a/maca_trans_parser/src/maca_trans_parser_conll2fann.c +++ b/maca_trans_parser/src/maca_trans_parser_conll2fann.c @@ -26,7 +26,8 @@ void transform_treebank_help_message(context *ctx) context_conll_help_message(ctx); context_mcd_help_message(ctx); context_features_model_help_message(ctx); - fprintf(stderr, "IN TEST MODE\n"); + context_input_help_message(ctx); + fprintf(stderr, "IN TEST MODE\n"); context_vocabs_help_message(ctx); fprintf(stderr, "OUTPUT\n"); @@ -39,10 +40,10 @@ void transform_treebank_help_message(context *ctx) void transform_treebank_check_options(context *ctx) { - if(!ctx->input_filename - || ctx->help - /* || !ctx->mcd_filename */ - || !(ctx->cff_filename || ctx->fann_filename) + if( ctx->help + || !ctx->input_filename + /* || !ctx->mcd_filename */ + /* || !(ctx->cff_filename || ctx->fann_filename) */ ){ transform_treebank_help_message(ctx); exit(1); diff --git a/maca_trans_parser/src/simple_decoder_forrest.c b/maca_trans_parser/src/simple_decoder_forrest.c index baa8088..99624e0 100644 --- a/maca_trans_parser/src/simple_decoder_forrest.c +++ b/maca_trans_parser/src/simple_decoder_forrest.c @@ -62,7 +62,8 @@ void simple_decoder_buffer_forrest(context *ctx, FILE *f, feature_table *ft, int void simple_decoder_forrest(context *ctx) { FILE *f = (ctx->input_filename)? myfopen(ctx->input_filename, "r") : stdin; - feature_table *ft = feature_table_load(ctx->perc_model_filename, ctx->verbose); + /* feature_table *ft = feature_table_load(ctx->perc_model_filename, ctx->verbose); */ + feature_table *ft = NULL; int root_label; root_label = dico_string2int(ctx->dico_labels, ctx->root_label); -- GitLab