feat: add one-cap word-list generator
This commit is contained in:
parent
32be1eaa95
commit
b53a4edeee
@ -10,8 +10,6 @@ private:
|
|||||||
std::map<const char, WordRefList> groups_;
|
std::map<const char, WordRefList> groups_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Bucket() = default;
|
|
||||||
|
|
||||||
void insert(const WordList &word_list, size_t first_index, size_t last_index);
|
void insert(const WordList &word_list, size_t first_index, size_t last_index);
|
||||||
|
|
||||||
std::forward_list<const std::string *>
|
std::forward_list<const std::string *>
|
||||||
|
@ -11,6 +11,7 @@ public:
|
|||||||
WordList &multiply(size_t factor);
|
WordList &multiply(size_t factor);
|
||||||
WordList &shuffle();
|
WordList &shuffle();
|
||||||
|
|
||||||
|
static WordList oneCap();
|
||||||
static WordList fourCaps();
|
static WordList fourCaps();
|
||||||
static WordList fromFile(const std::filesystem::path &path);
|
static WordList fromFile(const std::filesystem::path &path);
|
||||||
|
|
||||||
|
@ -25,6 +25,19 @@ WordList &WordList::shuffle() {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WordList WordList::oneCap() {
|
||||||
|
const static std::string charset_ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
|
||||||
|
WordList word_list;
|
||||||
|
word_list.reserve(charset_.length());
|
||||||
|
|
||||||
|
for (auto char_1 : charset_) {
|
||||||
|
word_list.emplace_back(std::initializer_list<char>({char_1}));
|
||||||
|
}
|
||||||
|
|
||||||
|
return word_list;
|
||||||
|
};
|
||||||
|
|
||||||
WordList WordList::fourCaps() {
|
WordList WordList::fourCaps() {
|
||||||
const static std::string charset_ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
const static std::string charset_ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user