Turn a canonical direction key into reusable bootstrap text.
(direction_key: str)
| 251 | |
| 252 | |
| 253 | def _direction_to_seed_phrase(direction_key: str) -> str: |
| 254 | """Turn a canonical direction key into reusable bootstrap text.""" |
| 255 | try: |
| 256 | direction_lexicon = importlib.import_module("config.direction_lexicon") |
| 257 | return str(direction_lexicon.format_direction_label(direction_key, prefer_chinese=False) or "").strip() |
| 258 | except Exception: |
| 259 | cleaned = str(direction_key or "").strip() |
| 260 | if not cleaned: |
| 261 | return "" |
| 262 | return cleaned.replace("_", " ").replace("-", " ") |
| 263 | |
| 264 | |
| 265 | def _build_seed_directions(profile: Dict[str, Any], limit: int = 8) -> List[Dict[str, Any]]: |
no outgoing calls
no test coverage detected