| 994 | } |
| 995 | |
| 996 | long ImageSearchAlgorithms::FindStr(std::map<point_t, ocr_rec_t> &ps, const vector<wstring> &vstr, long &retx, |
| 997 | long &rety) { |
| 998 | retx = rety = -1; |
| 999 | |
| 1000 | std::vector<ocr_text_span_t> spans; |
| 1001 | const std::wstring str = build_ocr_text_spans(ps, spans); |
| 1002 | |
| 1003 | for (size_t i = 0; i < vstr.size(); ++i) { |
| 1004 | if (vstr[i].empty()) |
| 1005 | continue; |
| 1006 | |
| 1007 | const size_t idx = str.find(vstr[i]); |
| 1008 | if (idx == std::wstring::npos) |
| 1009 | continue; |
| 1010 | |
| 1011 | const ocr_text_span_t *span = find_ocr_text_span(spans, idx); |
| 1012 | if (span == nullptr) |
| 1013 | continue; |
| 1014 | |
| 1015 | retx = span->point.x + _x1 + _dx; |
| 1016 | rety = span->point.y + _y1 + _dy; |
| 1017 | return static_cast<long>(i); |
| 1018 | } |
| 1019 | |
| 1020 | return -1; |
| 1021 | } |
| 1022 | |
| 1023 | long ImageSearchAlgorithms::FindStrEx(std::map<point_t, ocr_rec_t> &ps, const vector<wstring> &vstr, |
| 1024 | std::wstring &retstr) { |
nothing calls this directly
no test coverage detected