in text/text.cpp [237:265]
void processInputFileWithBlockList(TextModelRuntime* aacs, const std::string& inputDirectory, const std::string& fileName) {
auto filePath = inputDirectory + "\\" + fileName;
std::ifstream file(filePath);
if (!file.is_open()) {
std::cerr << "processInputFileWithBlockList, Could not open file: " << filePath << std::endl;
return;
}
std::vector<std::string> blocklist_names;
for (const auto& entry : std::filesystem::directory_iterator(inputDirectory)) {
if (entry.is_regular_file()) {
if (entry.path().extension() == ".csv") {
std::vector<char> buffer = readFile(entry.path().string());
auto blockListName = entry.path().stem().string();
aacs->AddBlocklist(blockListName, buffer.data(), buffer.size());
blocklist_names.push_back(blockListName);
std::cout << "processInputFileWithBlockList, adding block list : " << blockListName << std::endl;
}
}
}
std::string line;
while (std::getline(file, line)) {
processInputTextWithBlockList(aacs, line, blocklist_names);
}
file.close();
}