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