MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _truncate_text

Function _truncate_text

agents/reading-agent/main.py:727–732  ·  view source on GitHub ↗
(text: Any, max_chars: int)

Source from the content-addressed store, hash-verified

725
726def _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
734def _split_sentences(text: Any) -> List[str]:
735 normalized = _clean_pdf_evidence_text(text)

Callers 5

_pick_sentencesFunction · 0.85
_format_evidence_anchorFunction · 0.85
_normalize_string_listFunction · 0.85

Calls 1

_clean_textFunction · 0.70

Tested by

no test coverage detected