mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
!45190 修复节点复用时AI识别结果显示异常的问题
Merge pull request !45190 from 范盼/AI_Cache_Reusable
This commit is contained in:
commit
9148cb8f4e
@ -167,7 +167,7 @@ void DataDetectorAdapter::SetTextDetectTypes(const std::string& types)
|
||||
|
||||
bool DataDetectorAdapter::ParseOriText(const std::unique_ptr<JsonValue>& entityJson, std::string& text)
|
||||
{
|
||||
TAG_LOGI(AceLogTag::ACE_TEXT, "Parse origine text entry");
|
||||
TAG_LOGI(AceLogTag::ACE_TEXT, "Parse origin text entry");
|
||||
auto runtimeContext = Platform::AceContainer::GetRuntimeContext(Container::CurrentId());
|
||||
CHECK_NULL_RETURN(runtimeContext, false);
|
||||
if (runtimeContext->GetBundleName() != entityJson->GetString("bundleName")) {
|
||||
@ -182,6 +182,9 @@ bool DataDetectorAdapter::ParseOriText(const std::unique_ptr<JsonValue>& entityJ
|
||||
return false;
|
||||
}
|
||||
|
||||
aiSpanMap_.clear();
|
||||
aiSpanRects_.clear();
|
||||
detectTexts_.clear();
|
||||
AISpan aiSpan;
|
||||
for (int32_t i = 0; i < aiSpanArray->GetArraySize(); ++i) {
|
||||
auto item = aiSpanArray->GetArrayItem(i);
|
||||
@ -194,6 +197,7 @@ bool DataDetectorAdapter::ParseOriText(const std::unique_ptr<JsonValue>& entityJ
|
||||
aiDetectInitialized_ = true;
|
||||
text = entityJson->GetString("content");
|
||||
textForAI_ = text;
|
||||
lastTextForAI_ = textForAI_;
|
||||
if (textDetectResult_.menuOptionAndAction.empty()) {
|
||||
GetAIEntityMenu();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user