Skip to content
Snippets Groups Projects
Commit 4bc56c11 authored by Alexis Nasr's avatar Alexis Nasr
Browse files

bug fixing in mcf2conll.c - removed unnecessary messages in maca_lemmatizer

parent e928d8ae
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ void maca_lemmatizer_check_options(context *ctx){
}
}
char **read_fplm_file(char *fplm_filename, hash *form_pos_ht)
char **read_fplm_file(char *fplm_filename, hash *form_pos_ht, int debug_mode)
{
char form[1000];
char pos[1000];
......@@ -56,8 +56,10 @@ char **read_fplm_file(char *fplm_filename, hash *form_pos_ht)
/* if(!strcmp(form, "d")) */
/* fprintf(stderr, "form = %s pos = %s lemma = %s\n", form, pos, lemma); */
if(fields_nb != 4){
if(debug_mode){
fprintf(stderr, "form = %s pos = %s lemma = %s\n", form, pos, lemma);
fprintf(stderr, "incorrect fplm entry, skipping it\n");
}
continue;
}
strcat(form, "/");
......@@ -122,7 +124,7 @@ int main(int argc, char *argv[])
else
f = myfopen(ctx->conll_filename, "r");
lemma_array = read_fplm_file(ctx->fplm_filename, form_pos_ht);
lemma_array = read_fplm_file(ctx->fplm_filename, form_pos_ht, ctx->debug_mode);
/* look for a valid word */
while(fgets(buffer, 10000, f)){
......
......@@ -195,6 +195,7 @@ int main(int argc, char *argv[])
do{
w = word_buffer_b0(wb);
if(w){
printf("%d\t", index);
......@@ -247,6 +248,7 @@ int main(int argc, char *argv[])
}
index ++;
}
} while(word_buffer_move_right(wb));
if(ctx->conll_filename)
......
......@@ -93,7 +93,6 @@ void context_general_help_message(context *ctx)
fprintf(stderr, "\t-r --hratio <float> : set the occupation ratio of hash tables (default is 0.5)\n");
fprintf(stderr, "\t-D --maca_data_path <str> : path to the maca_data directory\n");
fprintf(stderr, "\t-L --language <str> : identifier of the language to use (default is fr)\n");
fprintf(stderr, "\t-S --stream : stream mode\n");
}
void context_model_help_message(context *ctx){
......@@ -145,7 +144,7 @@ void context_maca_data_path_help_message(context *ctx){
fprintf(stderr, "\t-D --maca_data_path : path to maca_data directory\n");
}
void context_root_label_help_message(context *ctx){
fprintf(stderr, "\t-R --root_label : name of the root label (default is \"root\")\n");
fprintf(stderr, "\t-R --root_label <str> : name of the root label (default is \"root\")\n");
}
void context_f2p_filename_help_message(context *ctx){
fprintf(stderr, "\t-P --f2p <file> : form to pos (f2p) filename\n");
......@@ -159,13 +158,12 @@ context *context_read_options(int argc, char *argv[])
ctx->program_name = strdup(argv[0]);
static struct option long_options[22] =
static struct option long_options[21] =
{
{"help", no_argument, 0, 'h'},
{"verbose", no_argument, 0, 'v'},
{"debug", no_argument, 0, 'd'},
{"conll", no_argument, 0, 'c'},
{"stream", no_argument, 0, 'S'},
{"model", required_argument, 0, 'm'},
{"input", required_argument, 0, 'i'},
{"iter", required_argument, 0, 'n'},
......@@ -203,10 +201,6 @@ context *context_read_options(int argc, char *argv[])
case 'c':
ctx->conll = 1;
break;
case 'S':
ctx->stream_mode = 1;
break;
case 'm':
ctx->perc_model_filename = strdup(optarg);
break;
......
......@@ -18,8 +18,8 @@
void decode_help_message(context *ctx)
{
context_general_help_message(ctx);
context_beam_help_message(ctx);
context_conll_help_message(ctx);
/* context_beam_help_message(ctx); */
/* context_conll_help_message(ctx); */
fprintf(stderr, "INPUT\n");
context_input_help_message(ctx);
context_mcd_help_message(ctx);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment