(term: str, section_text: str)
| 2348 | |
| 2349 | def _term_matches_daily_note_section(term: str, section_text: str) -> bool: |
| 2350 | normalized_term = _clean_text(term).replace("_", " ").replace("-", " ").lower() |
| 2351 | normalized_section = _clean_text(section_text).replace("_", " ").replace("-", " ").lower() |
| 2352 | if not normalized_term or not normalized_section: |
| 2353 | return False |
| 2354 | if normalized_term in normalized_section: |
| 2355 | return True |
| 2356 | tokens = [token for token in re.split(r"[^0-9a-zA-Z\u4e00-\u9fff]+", normalized_term) if len(token) >= 3] |
| 2357 | return bool(tokens) and all(token in normalized_section for token in tokens) |
| 2358 | |
| 2359 | |
| 2360 | def _daily_note_topic_methods(section_body: str, user_profile: Optional[Dict[str, Any]]) -> List[str]: |
| 2361 | section_text = re.sub(r"\s+", " ", section_body) |
no test coverage detected