source: app/src/gue/common_guess.cc @ 40358d2

help
Last change on this file since 40358d2 was 40358d2, checked in by obrebski <obrebski@…>, 16 years ago

lem, gue, kor, cor sprawdzaja czy slownik istnieje i da sie otworzyc

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@47 e293616e-ec6a-49c2-aa92-f4a8b91c5d16

  • Property mode set to 100644
File size: 1.2 KB
Line 
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;
10bool weights=true;
11
12void 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/lem.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=false;
59
60}
Note: See TracBrowser for help on using the repository browser.