MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / extract_google_scholar_url

Function extract_google_scholar_url

agents/master-coordinator/main.py:1055–1065  ·  view source on GitHub ↗

Extract the first Google Scholar profile URL from arbitrary user text.

(text: Any)

Source from the content-addressed store, hash-verified

1053
1054
1055def extract_google_scholar_url(text: Any) -> Optional[str]:
1056 """Extract the first Google Scholar profile URL from arbitrary user text."""
1057 match = GOOGLE_SCHOLAR_URL_RE.search(str(text or ""))
1058 if not match:
1059 return None
1060 url = str(match.group("url") or "").strip().rstrip(".,);]\u3002\uff0c\uff1b")
1061 if not url:
1062 return None
1063 if "://" not in url:
1064 url = f"https://{url.lstrip('/')}"
1065 return url
1066
1067
1068def looks_like_pdf_http_url(url: Any) -> bool:

Callers 3

handle_cold_startMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected