Return a canonical direction when a keyword is too broad for hard must-read.
(value: str)
| 131 | |
| 132 | |
| 133 | def _resolve_broad_must_read_keyword(value: str) -> Optional[str]: |
| 134 | """Return a canonical direction when a keyword is too broad for hard must-read.""" |
| 135 | cleaned = clean_must_read_value(value) |
| 136 | normalized_key = normalize_direction_key(cleaned) |
| 137 | if normalized_key in BROAD_MUST_READ_KEYWORD_ALIASES: |
| 138 | return BROAD_MUST_READ_KEYWORD_ALIASES[normalized_key] |
| 139 | |
| 140 | resolved = resolve_canonical_direction(cleaned, include_paper_terms=True) |
| 141 | if not resolved: |
| 142 | return None |
| 143 | |
| 144 | canonical = str(resolved.get("canonical_name") or "").strip() |
| 145 | if canonical in BROAD_MUST_READ_KEYWORD_DIRECTIONS: |
| 146 | return canonical |
| 147 | return None |
| 148 | |
| 149 | |
| 150 | def _keyword_resolves_to_direction(value: Any, canonical_direction: str) -> bool: |
no test coverage detected