修复:完整展示AI原文并穿插图表,统一运行反馈与变化符号

This commit is contained in:
2026-11-02 12:03:37 +08:00
parent cf8e25a30d
commit 903fa94c00
35 changed files with 1016 additions and 172 deletions
+5 -1
View File
@@ -16,7 +16,11 @@ export function checkedConclusionComparison(sentence: string): ConclusionCompari
const value = sentence.replace(/\*\*/g, '').trim();
const match = value.match(/^([^。;\n]{1,50}?)(综合合格率|黑片合格率|亮片合格率|合格率)(?:为|是|[::])?\s*(\d+(?:\.\d+)?%)\s*[,,]\s*(?:较|相比|对比|比)\s*([^,,。;\n]{1,30}?)的?\s*(\d+(?:\.\d+)?%)\s*(下降|上升|提高|降低)\s*(\d+(?:\.\d+)?)(个百分点|pp)[。.]?$/);
if (!match || [match[3], match[5]].some(rate => Number.parseFloat(rate) > 100)) return null;
return { metric: match[2], currentLabel: match[1], current: match[3], previousLabel: match[4].replace(/的$/, ''), previous: match[5], direction: match[6], change: match[7], unit: match[8], original: value };
const currentRate = Number.parseFloat(match[3]), previousRate = Number.parseFloat(match[5]);
const isDecrease = /下降|降低/.test(match[6]);
if (currentRate !== previousRate && (currentRate < previousRate) !== isDecrease) return null;
const change = `${isDecrease ? '-' : '+'}${match[7]}`;
return { metric: match[2], currentLabel: match[1], current: match[3], previousLabel: match[4].replace(/的$/, ''), previous: match[5], direction: match[6], change, unit: match[8], original: value };
}
function topicMatches(title: string, visual: AnalysisVisual): boolean {