MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / caption_keywords

Function caption_keywords

scripts/plan_figures.py:270–279  ·  view source on GitHub ↗
(caption: str, *, limit: int = 5)

Source from the content-addressed store, hash-verified

268
269
270def caption_keywords(caption: str, *, limit: int = 5) -> list[str]:
271 words = re.findall(r"[A-Za-z][A-Za-z-]{3,}", caption.lower())
272 picked: list[str] = []
273 for word in words:
274 if word in STOPWORDS or word in picked:
275 continue
276 picked.append(word)
277 if len(picked) >= limit:
278 break
279 return picked
280
281
282def match_snippet(page_text: str, needle: str, *, radius: int = 90) -> str:

Callers 1

attach_candidate_imagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected