| 357 | } |
| 358 | |
| 359 | void OCRer::postproc_replace_(Result& res) const |
| 360 | { |
| 361 | for (const auto& [regex, format] : param_.replace) { |
| 362 | auto replaced_text = boost::regex_replace(res.text, gen_regex(regex), format); |
| 363 | LogDebug << VAR(res.text) << VAR(regex) << VAR(format) << VAR(replaced_text); |
| 364 | res.text = std::move(replaced_text); |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | bool OCRer::filter_by_required(const Result& res, const std::vector<std::wstring>& expected) const |
| 369 | { |