Last change
on this file since f924e4b was
5f4d9c3,
checked in by Maciej Prill <mprill@…>, 13 years ago
|
Rewritten the build system, added lem UTF-8 version.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[5f4d9c3] | 1 | #include <stdlib.h> |
---|
| 2 | #include <string.h> |
---|
| 3 | #include "common_guess.h" |
---|
| 4 | |
---|
| 5 | int guess_count=0; |
---|
| 6 | double delta=0.1; |
---|
| 7 | int cut_off=100; |
---|
| 8 | char dictionary[255]; |
---|
| 9 | bool per_info=false; |
---|
| 10 | bool weights=false; |
---|
| 11 | |
---|
| 12 | void process_guess_options(gengetopt_args_info* args) |
---|
| 13 | { |
---|
| 14 | |
---|
| 15 | if(args->dictionary_given) |
---|
| 16 | { |
---|
| 17 | expand_path(args->dictionary_arg,dictionary); |
---|
| 18 | if(file_accessible(dictionary)!=0) |
---|
| 19 | { |
---|
| 20 | fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary); |
---|
| 21 | exit(1); |
---|
| 22 | } |
---|
| 23 | } |
---|
| 24 | else if (args->dictionary_home_given && args->language_given) |
---|
| 25 | { |
---|
| 26 | char buf[255]; |
---|
| 27 | expand_path(args->dictionary_home_arg, buf); |
---|
| 28 | sprintf(dictionary,"%s/%s/gue.bin",buf,args->language_arg); |
---|
| 29 | if(file_accessible(dictionary)!=0) |
---|
| 30 | { |
---|
| 31 | fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary); |
---|
| 32 | exit(1); |
---|
| 33 | } |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | if(args->guess_count_given) |
---|
| 37 | guess_count=args->guess_count_arg; |
---|
| 38 | else |
---|
| 39 | guess_count=0; |
---|
| 40 | |
---|
| 41 | if(guess_count==0) |
---|
| 42 | guess_count=100; |
---|
| 43 | |
---|
| 44 | if(args->delta_given) |
---|
| 45 | delta=args->delta_arg; |
---|
| 46 | else |
---|
| 47 | delta=0.1; |
---|
| 48 | |
---|
| 49 | if(args->cut_off_given) |
---|
| 50 | cut_off=args->cut_off_arg; |
---|
| 51 | else |
---|
| 52 | cut_off=100; |
---|
| 53 | |
---|
| 54 | if(args->per_info_given) |
---|
| 55 | per_info=args->per_info_flag; |
---|
| 56 | |
---|
| 57 | if(args->weights_given) |
---|
| 58 | weights=true; |
---|
| 59 | |
---|
| 60 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.