MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / repl_abbr

Function repl_abbr

fix_test.py:34–41  ·  view source on GitHub ↗
(match)

Source from the content-addressed store, hash-verified

32# CE\n\nClinical Evaluation -> | CE | Clinical Evaluation |
33import itertools
34def repl_abbr(match):
35 lines = [x.strip() for x in match.group(0).split('\n') if x.strip()]
36 if len(lines) % 2 != 0:
37 return match.group(0)
38 out = ["| Abbreviation | Definition |", "|---|---|"]
39 for i in range(0, len(lines), 2):
40 out.append(f"| {lines[i]} | {lines[i+1]} |")
41 return '\n'.join(out) + '\n\n'
42
43# Only apply to the block under 1.5. Abbreviations up to the first markdown table or header
44abbr_block_match = re.search(r'(###\s*1\.5\.\s*Abbreviations\n\n)(.*?)(?=\n\||\n#)', content, re.DOTALL)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected