Compare commits
2 commits
84f6fb2c70
...
2fce3c4a48
Author | SHA1 | Date | |
---|---|---|---|
千住柱間 | 2fce3c4a48 | ||
千住柱間 | 7508ce6d0d |
|
@ -45,9 +45,8 @@ int main(int argc, char* argv[]) {
|
||||||
const auto trie = xcdat::load<xcdat::trie_15_type>(dict_file);
|
const auto trie = xcdat::load<xcdat::trie_15_type>(dict_file);
|
||||||
|
|
||||||
std::vector<std::string> substrings;
|
std::vector<std::string> substrings;
|
||||||
|
std::vector<Entry> results;
|
||||||
while (!search_string.empty()) {
|
while (!search_string.empty()) {
|
||||||
std::vector<Entry> results;
|
|
||||||
auto itr = trie.make_prefix_iterator(search_string);
|
auto itr = trie.make_prefix_iterator(search_string);
|
||||||
|
|
||||||
while (itr.next()) {
|
while (itr.next()) {
|
||||||
|
@ -79,9 +78,13 @@ int main(int argc, char* argv[]) {
|
||||||
if (pos != std::string::npos) {
|
if (pos != std::string::npos) {
|
||||||
search_string.erase(0, pos + smallest_prefix.length());
|
search_string.erase(0, pos + smallest_prefix.length());
|
||||||
}
|
}
|
||||||
|
else break;
|
||||||
|
|
||||||
std::cout << search_string << std::endl;
|
std::cout << search_string << std::endl;
|
||||||
|
|
||||||
|
if (smallest_prefix.length() == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
if (debug_mode) {
|
if (debug_mode) {
|
||||||
raw_output += search_string + '\n';
|
raw_output += search_string + '\n';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue