source: app/src/lem/common_lem.cc @ 91ed676

help
Last change on this file since 91ed676 was 40358d2, checked in by obrebski <obrebski@…>, 17 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_lem.h"
4
5char dictionary[255];
6
7void process_lem_options(gengetopt_args_info* args)
8{
9
10  if(args->dictionary_given)
11    {
12      expand_path(args->dictionary_arg,dictionary);
13      if(file_accessible(dictionary)!=0)
14        {
15          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
16          exit(1);
17        }
18    }
19  else if (args->dictionary_home_given && args->language_given)
20    {
21      char buf[255];
22      expand_path(args->dictionary_home_arg, buf);
23      sprintf(dictionary,"%s/%s/lem.bin",buf,args->language_arg);
24      if(file_accessible(dictionary)!=0)
25        {
26          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary);
27          exit(1);
28        }
29    }
30}
31
32
33// STARE
34//  if(args.dictionary_given)
35//    strcpy(dictionary, args.dictionary_arg);
36//  else {
37//     char path[256];
38//     //sprintf(path, "/etc/utt/data/%s/%s", args.locale_arg, DICT_FILE);
39//     //if (file_accessible(path) == 0)
40//     //  strcpy(dictionary, path);
41//     //else {
42//       sprintf(path, "%s/%s", utt_dir, DICT_FILE);
43//       if (file_accessible(path) == 0)
44//      strcpy(dictionary, path);
45//       else {
46//      fprintf(stderr, "Cannot find dictionary!\n");
47//      exit(1);
48//       }
49//       //}
50//   }
51
Note: See TracBrowser for help on using the repository browser.