refactor: add WordList type
This commit is contained in:
parent
dae5445efc
commit
48f05ddb4f
18 changed files with 111 additions and 92 deletions
|
@ -4,18 +4,18 @@
|
|||
#include "sorted_linear_finder.h"
|
||||
#include "timer.h"
|
||||
#include "tree_finder.h"
|
||||
#include "word_list_generator.h"
|
||||
#include "word_list.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
using std::string, std::string_view, std::vector, std::cout, std::endl;
|
||||
using std::string, std::string_view, std::cout, std::endl;
|
||||
|
||||
vector<string> generate_word_list(size_t size_factor = 1) {
|
||||
WordList generate_word_list(size_t size_factor = 1) {
|
||||
cout << endl << "generating word list (" << size_factor << "x)" << endl;
|
||||
|
||||
Timer generator_timer;
|
||||
auto word_list = WordListGenerator::generate(size_factor);
|
||||
auto word_list = WordList::fourCaps().multiply(size_factor).shuffle();
|
||||
generator_timer.stop();
|
||||
|
||||
cout << "word list generator took " << generator_timer << endl;
|
||||
|
@ -36,7 +36,7 @@ void test_finder_search(Finder &finder, string_view name,
|
|||
}
|
||||
|
||||
template <typename FINDER>
|
||||
void test_finder(const vector<string> &word_list, string_view finder_name) {
|
||||
void test_finder(const WordList &word_list, string_view finder_name) {
|
||||
cout << endl << "running " << finder_name << endl;
|
||||
|
||||
Timer constructor_timer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue