diff options
Diffstat (limited to 'generator/main.cpp')
-rw-r--r-- | generator/main.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/generator/main.cpp b/generator/main.cpp new file mode 100644 index 0000000..c958421 --- /dev/null +++ b/generator/main.cpp | |||
@@ -0,0 +1,35 @@ | |||
1 | #include <exception> | ||
2 | #include <iostream> | ||
3 | |||
4 | #include "generator.h" | ||
5 | |||
6 | void printUsage() { | ||
7 | std::cout << "usage: generator agid wordnet cmudict wordfreq output" | ||
8 | << std::endl; | ||
9 | std::cout << "agid :: path to an AGID infl.txt file" << std::endl; | ||
10 | std::cout << "wordnet :: path to a WordNet prolog data directory" | ||
11 | << std::endl; | ||
12 | std::cout << "cmudict :: path to a CMUDICT pronunciation file" << std::endl; | ||
13 | std::cout << "wordfreq :: path to a word frequency CSV file" << std::endl; | ||
14 | std::cout << "output :: datafile output path" << std::endl; | ||
15 | } | ||
16 | |||
17 | int main(int argc, char** argv) { | ||
18 | if (argc == 6) { | ||
19 | try { | ||
20 | generator app(argv[1], argv[2], argv[3], argv[4], argv[5]); | ||
21 | |||
22 | try { | ||
23 | app.run(); | ||
24 | } catch (const std::exception& e) { | ||
25 | std::cout << e.what() << std::endl; | ||
26 | } | ||
27 | } catch (const std::exception& e) { | ||
28 | std::cout << e.what() << std::endl; | ||
29 | printUsage(); | ||
30 | } | ||
31 | } else { | ||
32 | std::cout << "lingo randomizer generator" << std::endl; | ||
33 | printUsage(); | ||
34 | } | ||
35 | } | ||