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

Function meaningful_units

scripts/lint_note.py:1324–1336  ·  view source on GitHub ↗
(body: str, generic_patterns: list[str] | None = None)

Source from the content-addressed store, hash-verified

1322
1323
1324def meaningful_units(body: str, generic_patterns: list[str] | None = None) -> list[str]:
1325 generic_patterns = generic_patterns or []
1326 kept: list[str] = []
1327 for unit in text_units(body):
1328 if is_placeholder_like(unit):
1329 continue
1330 if generic_patterns and matches_any_pattern(unit, generic_patterns):
1331 continue
1332 compact = re.sub(r"[\s,。,.;;::、\-*+()()【】\[\]]+", "", unit)
1333 if len(compact) < 12:
1334 continue
1335 kept.append(unit)
1336 return kept
1337
1338
1339def has_number_token(text: str) -> bool:

Callers 1

Calls 3

text_unitsFunction · 0.85
is_placeholder_likeFunction · 0.85
matches_any_patternFunction · 0.85

Tested by

no test coverage detected