Classify a standard into a category based on number and title.
(entry: dict)
| 246 | |
| 247 | |
| 248 | def classify_standard(entry: dict) -> str: |
| 249 | """Classify a standard into a category based on number and title.""" |
| 250 | search_text = f"{entry['number']} {entry.get('title', '')}" |
| 251 | for pattern, category in CATEGORY_RULES: |
| 252 | if re.search(pattern, search_text, re.IGNORECASE): |
| 253 | return category |
| 254 | return "other" |
| 255 | |
| 256 | |
| 257 | def fetch_and_parse(args) -> list[dict]: |
no test coverage detected