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

Function text_units

scripts/lint_note.py:1309–1321  ·  view source on GitHub ↗
(body: str)

Source from the content-addressed store, hash-verified

1307
1308
1309def text_units(body: str) -> list[str]:
1310 units: list[str] = []
1311 for line in cleaned_section_lines(body):
1312 stripped = re.sub(r"^(?:[-*+]|\d+[.)、])\s*", "", line).strip()
1313 if stripped:
1314 units.append(stripped)
1315 if units:
1316 return units
1317 return [
1318 part.strip()
1319 for part in re.split(r"[。!?!?]\s*", normalized_section_content(body))
1320 if part.strip()
1321 ]
1322
1323
1324def meaningful_units(body: str, generic_patterns: list[str] | None = None) -> list[str]:

Callers 1

meaningful_unitsFunction · 0.85

Calls 2

cleaned_section_linesFunction · 0.85

Tested by

no test coverage detected