source: _old/app/src/gue/common_guess.cc @ 57728c1

Last change on this file since 57728c1 was 57728c1, checked in by Mateusz Hromada <ruanda@…>, 15 years ago

Move old files to _old dir.

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[25ae32e]1#include <stdlib.h>
2#include <string.h>
3#include "common_guess.h"
4
5int guess_count=0;
6double delta=0.1;
7int cut_off=100;
8char dictionary[255];
9bool per_info=false;
[19760ef]10bool weights=false;
[25ae32e]11
12void process_guess_options(gengetopt_args_info* args)
13{
14
15  if(args->dictionary_given)
16    {
17      expand_path(args->dictionary_arg,dictionary);
[40358d2]18      if(file_accessible(dictionary)!=0)
19        {
20          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
21          exit(1);
22        }
[25ae32e]23    }
24  else if (args->dictionary_home_given && args->language_given)
25    {
26      char buf[255];
27      expand_path(args->dictionary_home_arg, buf);
[6ac84d8]28      sprintf(dictionary,"%s/%s/gue.bin",buf,args->language_arg);
[40358d2]29      if(file_accessible(dictionary)!=0)
30        {
31          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
32          exit(1);
33        }
[25ae32e]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)
[19760ef]58    weights=true;
[25ae32e]59
60}
Note: See TracBrowser for help on using the repository browser.