(metadata: Dict[str, Any])
| 597 | return "; ".join(institutions[:8]) |
| 598 | |
| 599 | |
| 600 | def _report_institution(metadata: Dict[str, Any]) -> str: |
| 601 | for key in ("institution", "affiliation", "institutions", "affiliations"): |
| 602 | value = metadata.get(key) |
| 603 | if isinstance(value, list): |
| 604 | joined = "; ".join(str(item).strip() for item in value if str(item).strip()) |
| 605 | if joined: |
| 606 | return joined |
| 607 | text = str(value or "").strip() |
| 608 | if text and text not in {"未提供", "Not provided", "unknown", "Unknown"}: |
| 609 | return text |
| 610 | return _extract_institution_from_pdf(metadata.get("pdf_path")) |
| 611 | |
| 612 |
no test coverage detected