diff --git a/src/common/cmdline_common.ggo b/src/common/cmdline_common.ggo index 45a385a..fa147ad 100644 --- a/src/common/cmdline_common.ggo +++ b/src/common/cmdline_common.ggo @@ -3,32 +3,30 @@ option "input" f "Input file" string no -option "output" o "Output file for succesfully processed segments" string no - -option "fail" e "Output file for unsuccesfully processed segments " string no +option "output" o "Output file" string no option "only-fail" - "Print only segments the program failed to process" flag off hidden option "no-fail" - "Print only segments the program processed" flag off hidden -option "copy" c "Copy succesfully processed segments to standard output" flag off +option "copy" c "Copy succesfully processed segments to output" flag off -option "process" p "Process segments with this tag" string no multiple +option "process" p "Process segments of this type only" string no multiple -option "select" s "Select only segments with this field" string no multiple +option "select" s "Select only segments containing this field" string no multiple -option "ignore" S "Select only segments without this field" string no multiple +option "ignore" S "Select only segments, which doesn't contain this field" string no multiple -option "output-field" O "Output field name" string no +option "output-field" O "Output field name (default: program name)" string no -option "input-field" I "Input field name" string no multiple +option "input-field" I "Input field name (default: the FORM field)" string no multiple option "interactive" i "Toggle interactive mode" flag off option "config" - "Configuration file" string typestr="FILENAME" no -option "one-field" 1 "Print all results in one segments (creates ambiguous annotation)" flag off +option "one-field" 1 "Print all alternative results in one field (creates compact ambiguous annotation)" flag off -option "one-line" - "Print annotation alternatives as additional fields" flag off +option "one-line" - "Print annotation alternatives as additional fields in the same segment" flag off option "language" - "Language." string no diff --git a/src/common/common.cc b/src/common/common.cc index d4a0b87..190a0d3 100644 --- a/src/common/common.cc +++ b/src/common/common.cc @@ -9,7 +9,6 @@ FILE* inputf=stdin; FILE* outputf=stdout; -FILE* failedf=stdout; bool copy_processed=0; bool one_field=false; bool one_line=false; @@ -171,13 +170,6 @@ void process_common_options(gengetopt_args_info* args, char* argv0) exit(1); } - if(args->fail_given) - if(!(failedf=fopen(args->fail_arg,"w"))) - { - fprintf(stderr,"Cannot open the output file: %s.\n", args->fail_arg); - exit(1); - } - if(args->input_field_given) fieldprefix(args->input_field_arg[0],input_field_prefix); else diff --git a/src/cor/main.cc b/src/cor/main.cc index a109c86..88da810 100644 --- a/src/cor/main.cc +++ b/src/cor/main.cc @@ -76,7 +76,7 @@ int main(int argc, char** argv) { } if ( tab.count() == 0) - fputs(line, failedf); + fputs(line, outputf); else { if(args.replace_flag) @@ -145,11 +145,7 @@ int main(int argc, char** argv) { } } - if(args.interactive_flag) - { - fflush(outputf); - fflush(failedf); - } + if(args.interactive_flag) fflush(outputf); } cmdline_parser_free(&args); } diff --git a/src/gue/main.cc b/src/gue/main.cc index 0f09a43..e901cac 100644 --- a/src/gue/main.cc +++ b/src/gue/main.cc @@ -56,8 +56,8 @@ int main(int argc, char** argv) { guess.ana(form, tab); - if ((tab.count()==0) && (!args.no_fail_flag)) // no guesses - analysis was unsuccessful - fputs(line, failedf); + if ((tab.count()==0)) // no guesses - analysis was unsuccessful + fputs(line, outputf); else { @@ -154,8 +154,7 @@ int main(int argc, char** argv) { } } } - if(args.interactive_flag) - fflush(outputf), fflush(failedf); + if(args.interactive_flag) fflush(outputf); } cmdline_parser_free(&args); diff --git a/src/kor/main.cc b/src/kor/main.cc index 8095c7b..75e055d 100644 --- a/src/kor/main.cc +++ b/src/kor/main.cc @@ -22,9 +22,6 @@ int main(int argc, char** argv) { Corr cor; - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -// strcpy(dictionary,"cor.bin"); - cor.load(dictionary); cor.t=args.distance_arg; @@ -71,7 +68,7 @@ int main(int argc, char** argv) { } if ( tab.count() == 0) - fputs(line, failedf); + fputs(line, inputf); else { tab.sort(); @@ -164,11 +161,7 @@ int main(int argc, char** argv) { } } - if(args.interactive_flag) - { - fflush(outputf); - fflush(failedf); - } + if(args.interactive_flag) fflush(outputf); } cmdline_parser_free(&args); } diff --git a/src/lem/common_lem.cc b/src/lem/common_lem.cc index 610e309..eb8a729 100644 --- a/src/lem/common_lem.cc +++ b/src/lem/common_lem.cc @@ -29,23 +29,3 @@ void process_lem_options(gengetopt_args_info* args) } } - -// STARE -// if(args.dictionary_given) -// strcpy(dictionary, args.dictionary_arg); -// else { -// char path[256]; -// //sprintf(path, "/etc/utt/data/%s/%s", args.locale_arg, DICT_FILE); -// //if (file_accessible(path) == 0) -// // strcpy(dictionary, path); -// //else { -// sprintf(path, "%s/%s", utt_dir, DICT_FILE); -// if (file_accessible(path) == 0) -// strcpy(dictionary, path); -// else { -// fprintf(stderr, "Cannot find dictionary!\n"); -// exit(1); -// } -// //} -// } - diff --git a/src/lem/main.cc b/src/lem/main.cc index e2897d4..792baf3 100644 --- a/src/lem/main.cc +++ b/src/lem/main.cc @@ -65,7 +65,7 @@ int main(int argc, char** argv) { } if (tab.count() == 0) - fputs(line, failedf); + fputs(line, outputf); else { // mamy jakies opisy w slowniku @@ -123,8 +123,7 @@ int main(int argc, char** argv) { } } - if(args.interactive_flag) - fflush(outputf), fflush(failedf); + if(args.interactive_flag) fflush(outputf); } cmdline_parser_free(&args); diff --git a/src/lem_utf8/main.cc b/src/lem_utf8/main.cc index 6c1f7da..df60268 100644 --- a/src/lem_utf8/main.cc +++ b/src/lem_utf8/main.cc @@ -69,7 +69,7 @@ int main(int argc, char** argv) { lem->ana(p,tab); } if (tab.count() == 0) { - fputws(line, failedf); + fputws(line, outputf); } else @@ -132,8 +132,7 @@ int main(int argc, char** argv) { } } - if (args.interactive_flag) - fflush(outputf), fflush(failedf); + if (args.interactive_flag) fflush(outputf); } cmdline_parser_free(&args); diff --git a/src/tok.l/tok_cmdline.ggo b/src/tok.l/tok_cmdline.ggo index 560dd11..d9853a2 100644 --- a/src/tok.l/tok_cmdline.ggo +++ b/src/tok.l/tok_cmdline.ggo @@ -11,11 +11,11 @@ text " DESCRIPTION tok reads from standard input, identifies tokens on the basis of their orthographic form and writes a sequence of segments in UTT format to -the standard output. The type of the token is printed as the type field. +the standard output. OUTPUT FORMAT -UTT-file with four fields: start, length, type, and form. In the type field five types of tokens are distinguished: +UTT-file with four fields: START, LENGTH, TYPE, and FORM. In the TYPE field five types of tokens are distinguished: W (word) - continuous sequence of letters N (number) - continuous sequence of digits