From 90fbd47ca02f1a723134302ca978a7f9ef0eac04 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 2 Dec 2023 17:03:54 -0500 Subject: Starting to get some puzzles randomized --- generator/main.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 generator/main.cpp (limited to 'generator/main.cpp') 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 @@ +#include +#include + +#include "generator.h" + +void printUsage() { + std::cout << "usage: generator agid wordnet cmudict wordfreq output" + << std::endl; + std::cout << "agid :: path to an AGID infl.txt file" << std::endl; + std::cout << "wordnet :: path to a WordNet prolog data directory" + << std::endl; + std::cout << "cmudict :: path to a CMUDICT pronunciation file" << std::endl; + std::cout << "wordfreq :: path to a word frequency CSV file" << std::endl; + std::cout << "output :: datafile output path" << std::endl; +} + +int main(int argc, char** argv) { + if (argc == 6) { + try { + generator app(argv[1], argv[2], argv[3], argv[4], argv[5]); + + try { + app.run(); + } catch (const std::exception& e) { + std::cout << e.what() << std::endl; + } + } catch (const std::exception& e) { + std::cout << e.what() << std::endl; + printUsage(); + } + } else { + std::cout << "lingo randomizer generator" << std::endl; + printUsage(); + } +} -- cgit 1.4.1