MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / inspect_substantive_content

Function inspect_substantive_content

scripts/lint_note.py:1371–1438  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

1369
1370
1371def inspect_substantive_content(text: str) -> list[dict[str, object]]:
1372 issues: list[dict[str, object]] = []
1373 for section in REQUIRED_SECTIONS:
1374 body = section_body(text, section)
1375 content = normalized_section_content(body)
1376 if is_placeholder_like(content):
1377 issues.append(issue(section, "section_empty_shell", "error", content or section))
1378 if section not in {"关键结果", "引用"} and is_honest_missing_declaration(content):
1379 issues.append(issue(section, "section_honest_missing_not_allowed", "error", content))
1380
1381 innovation = section_body(text, "创新点")
1382 innovation_content = normalized_section_content(innovation)
1383 innovation_units = meaningful_units(innovation, GENERIC_INNOVATION_PATTERNS)
1384 if not innovation_units:
1385 issues.append(issue("创新点", "innovation_empty_shell", "error", innovation_content))
1386 elif len(innovation_units) < 2:
1387 issues.append(issue("创新点", "innovation_too_few_specific_points", "warning", innovation_content))
1388
1389 key_results = section_body(text, "关键结果")
1390 key_results_content = normalized_section_content(key_results)
1391 if is_honest_missing_declaration(key_results_content):
1392 issues.append(
1393 issue(
1394 "关键结果",
1395 "key_results_honest_missing_not_allowed",
1396 "error",
1397 key_results_content,
1398 )
1399 )
1400 elif not meaningful_units(key_results, GENERIC_KEY_RESULT_PATTERNS):
1401 issues.append(issue("关键结果", "key_results_empty_shell", "error", key_results_content))
1402 elif not has_number_token(key_results_content):
1403 issues.append(
1404 issue(
1405 "关键结果",
1406 "key_results_quantitative_result_missing",
1407 "warning",
1408 key_results_content,
1409 )
1410 )
1411
1412 references = section_body(text, "引用")
1413 references_content = normalized_section_content(references)
1414 if is_honest_missing_declaration(references_content):
1415 issues.append(issue("引用", "references_unavailable_declared", "warning", references_content))
1416 elif is_placeholder_like(references_content) or not has_reference_entry(references_content):
1417 issues.append(issue("引用", "references_placeholder", "error", references_content))
1418
1419 limitations = section_body(text, "局限")
1420 limitations_content = normalized_section_content(limitations)
1421 if not meaningful_units(limitations, GENERIC_LIMITATION_PATTERNS):
1422 issues.append(issue("局限", "limitations_empty_shell", "error", limitations_content))
1423
1424 for section in ("方法主线", "深度分析"):
1425 body = section_body(text, section)
1426 content = normalized_section_content(body)
1427 if not meaningful_units(body):
1428 issues.append(issue(section, "section_empty_shell", "error", content or section))

Calls 8

section_bodyFunction · 0.85
is_placeholder_likeFunction · 0.85
meaningful_unitsFunction · 0.85
has_number_tokenFunction · 0.85
has_reference_entryFunction · 0.85
issueFunction · 0.70