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

Function _keyword_hit_count

scripts/drift_engine.py:1216–1225  ·  view source on GitHub ↗
(selected_papers: Optional[List[Dict]], candidates: List[str])

Source from the content-addressed store, hash-verified

1214
1215def _keyword_hit_count(selected_papers: Optional[List[Dict]], candidates: List[str]) -> int:
1216 if not selected_papers or not candidates:
1217 return 0
1218 total = 0
1219 normalized_candidates = [str(item).lower().replace("-", " ") for item in candidates if str(item).strip()]
1220 for paper in selected_papers:
1221 text = _paper_text(paper)
1222 if any(candidate in text for candidate in normalized_candidates):
1223 total += 1
1224 return total
1225
1226
1227def _trigger_satisfied(
1228 checkfile: Dict[str, Any],

Callers 4

_extract_anchor_signalFunction · 0.85
_paper_matches_any_topicFunction · 0.85
_trigger_satisfiedFunction · 0.85

Calls 1

_paper_textFunction · 0.85

Tested by

no test coverage detected