json stamp_sents

This commit is contained in:
雾聪 2024-01-08 16:51:27 +08:00
parent 2396397169
commit 6be2975020

View File

@ -83,8 +83,15 @@ nlohmann::json handle_result(FUNASR_RESULT result) {
std::string tmp_stamp_sents = FunASRGetStampSents(result); std::string tmp_stamp_sents = FunASRGetStampSents(result);
if (tmp_stamp_sents != "") { if (tmp_stamp_sents != "") {
LOG(INFO) << "offline stamp_sents : " << tmp_stamp_sents; try{
jsonresult["stamp_sents"] = tmp_stamp_sents; nlohmann::json json_stamp = nlohmann::json::parse(tmp_stamp_sents);
LOG(INFO) << "offline stamp_sents : " << json_stamp;
jsonresult["stamp_sents"] = json_stamp;
}catch (std::exception const &e)
{
LOG(ERROR)<< tmp_stamp_sents << e.what();
jsonresult["stamp_sents"] = "";
}
} }
return jsonresult; return jsonresult;