(paper: Dict[str, Any])
| 1023 | |
| 1024 | |
| 1025 | def _format_subjects(paper: Dict[str, Any]) -> str: |
| 1026 | for key in ("subjects", "categories", "category", "primary_category", "tags", "topics"): |
| 1027 | value = paper.get(key) |
| 1028 | if value in (None, "", [], {}): |
| 1029 | continue |
| 1030 | if isinstance(value, dict): |
| 1031 | values = [str(item).strip() for item in value.values() if str(item).strip()] |
| 1032 | elif isinstance(value, (list, tuple, set)): |
| 1033 | values = [str(item).strip() for item in value if str(item).strip()] |
| 1034 | else: |
| 1035 | values = [str(value).strip()] |
| 1036 | if values: |
| 1037 | return ", ".join(_unique_preserve_order(values)) |
| 1038 | return "未知" |
| 1039 | |
| 1040 | |
| 1041 | def _collect_report_action_pairs(paper: Dict[str, Any], response_language: str = "zh") -> List[Tuple[str, str]]: |
no test coverage detected