(body: str, generic_patterns: list[str] | None = None)
| 1322 | |
| 1323 | |
| 1324 | def 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 | |
| 1339 | def has_number_token(text: str) -> bool: |
no test coverage detected