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

Function _split_sentences

agents/reading-agent/main.py:735–746  ·  view source on GitHub ↗
(text: Any)

Source from the content-addressed store, hash-verified

733
734
735def _split_sentences(text: Any) -> List[str]:
736 normalized = _clean_pdf_evidence_text(text)
737 if not normalized:
738 return []
739
740 parts = re.split(r"(?<=[。!?!?\.])\s+|(?<=;)\s+", normalized)
741 sentences: List[str] = []
742 for part in parts:
743 sentence = re.sub(r"\s+", " ", part).strip()
744 if len(sentence) >= 12 and not _is_noisy_pdf_evidence_text(sentence, min_chars=12):
745 sentences.append(sentence)
746 return sentences
747
748
749def _first_non_empty(*values: Any) -> str:

Callers 2

_pick_sentencesFunction · 0.85

Calls 2

_clean_pdf_evidence_textFunction · 0.85

Tested by

no test coverage detected