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

Function _term_in_text

scripts/common.py:1378–1384  ·  view source on GitHub ↗
(term: str, text: str)

Source from the content-addressed store, hash-verified

1376
1377
1378def _term_in_text(term: str, text: str) -> bool:
1379 normalized = _normalized_domain_label(term)
1380 if not normalized:
1381 return False
1382 if re.fullmatch(r"[a-z0-9][a-z0-9 ._+/#-]*", normalized):
1383 return re.search(rf"(?<![a-z0-9]){re.escape(normalized)}(?![a-z0-9])", text) is not None
1384 return normalized in text
1385
1386
1387def _count_term_hits(terms: list[str], text: str) -> int:

Callers 2

_count_term_hitsFunction · 0.85
domain_name_scoreFunction · 0.85

Calls 1

_normalized_domain_labelFunction · 0.85

Tested by

no test coverage detected