_phrase_in_text
Internal helper
This page documents an internal implementation helper, not a primary public API.
Source code in src/fabricops_kit/governance.py
| def _phrase_in_text(phrase: str, text: str) -> bool:
text_base = re.sub(r"([a-z0-9])([A-Z])", r"\1 \2", text or "")
phrase_base = re.sub(r"([a-z0-9])([A-Z])", r"\1 \2", phrase or "")
normalized_text = " ".join(t for t in re.split(r"[^a-zA-Z0-9]+", text_base.lower()) if t)
normalized_phrase = " ".join(t for t in re.split(r"[^a-zA-Z0-9]+", phrase_base.lower()) if t)
return bool(normalized_phrase) and normalized_phrase in normalized_text
|