fix(regulatory): 修复换行产品名称提取不全

This commit is contained in:
2026-06-07 11:30:48 +08:00
parent 72f18167c5
commit a34684e490
3 changed files with 79 additions and 4 deletions

View File

@@ -14,6 +14,21 @@ def test_extract_text_reads_plain_text(tmp_path):
assert result.content_hash
def test_extract_text_keeps_wrapped_product_name(tmp_path):
path = tmp_path / "申请表.txt"
path.write_text(
"产品名称:呼吸道合胞病毒、肺炎支原体核酸检测试剂盒\n"
"荧光PCR法\n"
"型号规格24人份/盒\n",
encoding="utf-8",
)
result = extract_text(path)
assert result.field_candidates["产品名称"] == "呼吸道合胞病毒、肺炎支原体核酸检测试剂盒 荧光PCR法"
assert result.field_candidates["型号规格"] == "24人份/盒"
def test_extract_text_reports_unsupported_file(tmp_path):
path = tmp_path / "image.png"
path.write_bytes(b"png")