Autogenerate words when not found

This commit is contained in:
Kevin Boyd
2021-06-18 09:44:00 -07:00
parent 601f11a55a
commit 611e21491c

View File

@@ -194,13 +194,15 @@ FloatingPointResults FillBufferGrilledCheese::Generate(
}
PatternGenerators::PatternGenerators() : words_(ReadDict()) {
if (words_.empty()) {
LOG(ERROR) << "No word list found.";
exit(1);
}
generators_.emplace_back(new FillBufferSystematic());
generators_.emplace_back(new FillBufferRandom());
generators_.emplace_back(new FillBufferText(words_));
if (!words_.empty()) {
generators_.emplace_back(new FillBufferText(words_));
} else {
LOG(WARN) << "No word list found, skipping Text patterns";
}
generators_.emplace_back(new FillBufferGrilledCheese());
}