58auto main(
int argc,
char *argv[]) ->
int {
61 GOOGLE_PROTOBUF_VERIFY_VERSION;
70 if (dawg ==
nullptr) {
71 std::vector<std::string> terms;
75 if (dictionary_file.is_open()) {
77 while (std::getline(dictionary_file, term)) {
78 terms.push_back(term);
80 dictionary_file.close();
83 std::sort(terms.begin(), terms.end());
91 std::string query_term;
93 while (
prompt(query_term) !=
"") {
95 case ll::Algorithm::STANDARD:
98 case ll::Algorithm::TRANSPOSITION:
101 case ll::Algorithm::MERGE_AND_SPLIT:
108 std::cout << std::endl;
109 std::cout <<
"Exiting ..." << std::endl;
112 serialize_protobuf(
dawg,
cli.serialization_path());
117 google::protobuf::ShutdownProtobufLibrary();
auto main(int argc, char *argv[]) -> int
std::string & prompt(std::string &query_term)
void query(ll::Dawg *dawg, const std::string &query_term, std::size_t max_distance)