Compose remote as model, host word, place line and map a remote role's area in prep
The area is the model's names, else the parts of the place texts that say remote, else the resolved places as their countries. VERSION 3 maps every open role again. run_roles maps the roles extract answered. "Remote Sensing" in a title is no remote work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
57cac5f896
commit
e4c0de4465
5 files changed
+139
-36
No files matched your search
+12
-5
@@ -52,6 +52,12 @@ _REMOTE_LINE = re.compile(
|
||||
_HYBRID_LINE = re.compile(r"\bhybrid|hjemmearbejde", re.IGNORECASE)
|
||||
|
||||
|
||||
#: "Remote" in a title that names a field or a product, not how the role is
|
||||
#: worked: "Remote Sensing Specialist", "Remote Control Engineer".
|
||||
_NOT_REMOTE_WORK = re.compile(r"\bremote[\s-]+(?:sensing|control\w*|monitoring)\b",
|
||||
re.IGNORECASE)
|
||||
|
||||
|
||||
def _line_word(text: str) -> str:
|
||||
"""`remote_of`'s reading of a line, else its Danish and Swedish words."""
|
||||
if found := remote_of(text):
|
||||
@@ -98,7 +104,8 @@ def employment(host: str, word: str,
|
||||
return lookup("employment", host, word, tables) or ""
|
||||
|
||||
|
||||
def _place_text(place: Any) -> str:
|
||||
def place_text(place: Any) -> str:
|
||||
"""A place of `raw`'s `places`, a dict with `text` or a string, as its text."""
|
||||
return str((place.get("text") if isinstance(place, Mapping) else place) or "")
|
||||
|
||||
|
||||
@@ -114,17 +121,17 @@ def remote(host: str, value: Any, places: Iterable[Any] = (), line: str = "",
|
||||
nothing, the place line or the place texts are read for a word
|
||||
(`remote_of`: "Hybrid, Berlin", and the Danish and Swedish words), then
|
||||
`title` when given, which the stage gives for a search provider's role
|
||||
only ("Backend Developer - Remote"), and last a place the reader marked
|
||||
remote is remote."""
|
||||
only ("Backend Developer - Remote", but not "Remote Sensing Analyst"),
|
||||
and last a place the reader marked remote is remote."""
|
||||
if value is True or value == "true":
|
||||
return "remote"
|
||||
said = value not in (None, False, "false")
|
||||
if said and (found := lookup("remote", host, str(value), tables)):
|
||||
return found
|
||||
places = list(places)
|
||||
if found := _line_word(line or "; ".join(map(_place_text, places))):
|
||||
if found := _line_word(line or "; ".join(map(place_text, places))):
|
||||
return found
|
||||
if title and (found := _line_word(title)):
|
||||
if title and (found := _line_word(_NOT_REMOTE_WORK.sub(" ", title))):
|
||||
return found
|
||||
if any(isinstance(p, Mapping) and p.get("remote") is True for p in places):
|
||||
return "remote"
|
||||
|
||||
Reference in new issue
Block a user