(value: Any, limit: int = 4, max_chars: int = 180)
| 4135 | |
| 4136 | |
| 4137 | def _normalize_string_list(value: Any, limit: int = 4, max_chars: int = 180) -> List[str]: |
| 4138 | if isinstance(value, str): |
| 4139 | candidates = re.split(r"\n+|[;;]+", value) |
| 4140 | elif isinstance(value, list): |
| 4141 | candidates = [str(item) for item in value] |
| 4142 | else: |
| 4143 | return [] |
| 4144 | |
| 4145 | items: List[str] = [] |
| 4146 | for candidate in candidates: |
| 4147 | cleaned = re.sub(r"^\s*[-*•\d\.\)\(]+\s*", "", str(candidate)).strip() |
| 4148 | if len(cleaned) >= 4: |
| 4149 | items.append(_truncate_text(cleaned, max_chars)) |
| 4150 | return _unique_preserve_order(items)[:limit] |
| 4151 | |
| 4152 | |
| 4153 | def _looks_like_extraction_noise(text: str) -> bool: |
no test coverage detected