MCPcopy Create free account
hub / github.com/Open-Quant/openquant / normalize_text

Function normalize_text

scripts/afml_semantic_index.py:73–79  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

71
72
73def normalize_text(text: str) -> str:
74 text = text.replace("\r\n", "\n").replace("\r", "\n")
75 text = RE_HYPHEN_BREAK.sub(r"\1\2", text)
76 text = RE_SOFT_LINEBREAK.sub(" ", text)
77 text = RE_MULTI_SPACE.sub(" ", text)
78 text = RE_MULTI_NL.sub("\n\n", text)
79 return text.strip()
80
81
82def normalize_line(line: str) -> str:

Callers 2

clean_pagesFunction · 0.85
flush_sectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected