(text: Any, max_chars: int)
| 725 | |
| 726 | def _truncate_text(text: Any, max_chars: int) -> str: |
| 727 | normalized = _clean_text(text) |
| 728 | if len(normalized) <= max_chars: |
| 729 | return normalized |
| 730 | clipped = normalized[: max_chars - 1].rsplit(" ", 1)[0].rstrip(" ,;:") or normalized[: max_chars - 1] |
| 731 | return f"{clipped}…" |
| 732 | |
| 733 | |
| 734 | def _split_sentences(text: Any) -> List[str]: |
| 735 | normalized = _clean_pdf_evidence_text(text) |
no test coverage detected