diff --git a/a.out b/a.out new file mode 100755 index 0000000..207aa1f Binary files /dev/null and b/a.out differ diff --git a/src/main.cc b/src/main.cc index 7ca1079..febd5e0 100644 --- a/src/main.cc +++ b/src/main.cc @@ -45,9 +45,8 @@ int main(int argc, char* argv[]) { const auto trie = xcdat::load(dict_file); std::vector substrings; - + std::vector results; while (!search_string.empty()) { - std::vector results; auto itr = trie.make_prefix_iterator(search_string); while (itr.next()) { @@ -79,9 +78,13 @@ int main(int argc, char* argv[]) { if (pos != std::string::npos) { search_string.erase(0, pos + smallest_prefix.length()); } + else break; std::cout << search_string << std::endl; + if (smallest_prefix.length() == 0) + break; + if (debug_mode) { raw_output += search_string + '\n'; }