规范化分组名称
(group: str)
| 229 | |
| 230 | |
| 231 | def normalize_group(group: str) -> str: |
| 232 | """规范化分组名称""" |
| 233 | if not group: |
| 234 | return "" |
| 235 | |
| 236 | # 先尝试直接映射 |
| 237 | if group in GROUP_MAPPING: |
| 238 | return GROUP_MAPPING[group] |
| 239 | |
| 240 | # 清洗后再映射 |
| 241 | cleaned = clean_spaces(strip_decorations(group)) |
| 242 | if cleaned in GROUP_MAPPING: |
| 243 | return GROUP_MAPPING[cleaned] |
| 244 | |
| 245 | return cleaned |
| 246 | |
| 247 | |
| 248 | def clean_source(source: dict, grade: bool = False) -> dict: |
no test coverage detected