update log

This commit is contained in:
MistEO
2021-07-31 01:23:51 +08:00
parent 0dd2815ee4
commit c8da20dd96
2 changed files with 9 additions and 5 deletions

View File

@@ -87,7 +87,7 @@ namespace asst {
if (vector.empty()) {
return std::string();
}
static const std::string inter = " ,";
static const std::string inter = ", ";
std::string str;
for (const T& ele : vector) {
if (to_gbk) {
@@ -110,7 +110,7 @@ namespace asst {
if (vector.empty()) {
return std::string();
}
static const std::string inter = " ,";
static const std::string inter = ", ";
std::string str;
for (const T& ele : vector) {
str += std::to_string(ele) + inter;

View File

@@ -214,21 +214,25 @@ std::optional<std::vector<std::pair<std::vector<std::string>, OperCombs>>>
}
std::vector<TextArea> ider_result = m_pIder->ocr_detect(image);
//DebugTrace("All ocr text: ", ider_result);
std::vector<TextArea> filt_result; // 识别的文字中是tag名的结果
std::vector<TextArea> filt_result;
std::string ider_str;
for (TextArea& res : ider_result) {
// 替换一些常见的文字识别错误
// TODO: 这块时间复杂度有点高,待优化
for (const auto& [src, cor] : m_configer.m_ocr_replace) {
res.text = StringReplaceAll(res.text, src, cor);
}
ider_str += res.text + " ,";
for (const std::string& t : m_recruit_configer.m_all_tags) {
if (res.text == t) {
filt_result.emplace_back(std::move(res));
}
}
}
if (ider_str.back() == ',') {
ider_str.pop_back();
}
DebugTrace("All ocr text: ", Utf8ToGbk(ider_str));
if (filt_result.size() != 5) {
DebugTraceError("Error, Tags recognition error!!!");