"""What the search providers' headlines and town lines say about where the work is done, in Danish, Swedish and English. Shared by the search readers; a board states its own remote flag and needs none of this.""" from __future__ import annotations import re #: "Birkerød, Hybrid position", "Nordhavn og mulighed for hjemmearbejde". _HYBRID = re.compile(r"\bhybrid|hjemmearbejde", re.IGNORECASE) _REMOTE = re.compile( r"\bremote\b|fjernarbejde|fuldt hjemmearbejde|distansarbete|på distans", re.IGNORECASE) def remote_word(text: str) -> str | None: """`remote`, `hybrid` or None: the word the text says.""" if _REMOTE.search(text): return "remote" return "hybrid" if _HYBRID.search(text) else None