1 | #include <stdlib.h> |
---|
2 | #include <string.h> |
---|
3 | #include "common_lem.h" |
---|
4 | |
---|
5 | char dictionary[255]; |
---|
6 | |
---|
7 | void 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 | |
---|