@bytenew/bn-applet-ui 1.1.76 → 1.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -29983,6 +29983,19 @@ function findParsedRegionConflict(parse, originalAddress) {
|
|
|
29983
29983
|
return '';
|
|
29984
29984
|
}
|
|
29985
29985
|
|
|
29986
|
+
/**
|
|
29987
|
+
* 本地识别的省市区全部为空,但输入文本中出现省/市/区/县等行政区划文字时,
|
|
29988
|
+
* 说明本地识别遗漏了行政区划(如姓名前缀把省份顶出匹配窗口),
|
|
29989
|
+
* 也需要调用大模型接口重新识别
|
|
29990
|
+
*/
|
|
29991
|
+
function shouldFallbackToAIWhenEmpty(parse, originalAddress) {
|
|
29992
|
+
if (parse.province || parse.city || parse.area) {
|
|
29993
|
+
return false;
|
|
29994
|
+
}
|
|
29995
|
+
var compareText = normalizeAddressForCompare(originalAddress);
|
|
29996
|
+
return /[省市区县]/.test(compareText);
|
|
29997
|
+
}
|
|
29998
|
+
|
|
29986
29999
|
/**
|
|
29987
30000
|
* 本地识别错误时,使用原生 fetch 调用大模型接口重新识别
|
|
29988
30001
|
* options.platform == 'plugin'(插件端):POST /project/column/addressBychat,请求体 {content: 待识别文本}
|
|
@@ -30082,9 +30095,10 @@ function _addressParse() {
|
|
|
30082
30095
|
parseArea(list);
|
|
30083
30096
|
}
|
|
30084
30097
|
cleanAddress = preprocessAddress(address);
|
|
30085
|
-
parse = parseAddressDetail(cleanAddress, sourceData || {}, address); //
|
|
30098
|
+
parse = parseAddressDetail(cleanAddress, sourceData || {}, address); // 识别完毕后校验:输入文本中有明确的省市区文字,但识别结果与之不一致时,调用大模型接口重新识别;
|
|
30099
|
+
// 省市区识别全为空但输入中出现省市区等行政区划文字时,同样调用大模型接口重新识别
|
|
30086
30100
|
conflictLevel = findParsedRegionConflict(parse, address);
|
|
30087
|
-
if (!conflictLevel) {
|
|
30101
|
+
if (!(conflictLevel || shouldFallbackToAIWhenEmpty(parse, address))) {
|
|
30088
30102
|
_context.n = 2;
|
|
30089
30103
|
break;
|
|
30090
30104
|
}
|