(self, source: Any)
| 104 | return self._chunk_by_words(text, source_id, source_column) |
| 105 | |
| 106 | def _load(self, source: Any) -> str: |
| 107 | from pathlib import Path |
| 108 | |
| 109 | if isinstance(source, Path) and source.exists(): |
| 110 | return Path(source).read_text() |
| 111 | if isinstance(source, str): |
| 112 | if source.endswith(".txt") and Path(source).exists(): |
| 113 | return Path(source).read_text() |
| 114 | return str(source) |
| 115 | |
| 116 | def _chunk_by_words( |
| 117 | self, text: str, source_id: str, source_column: str |
no test coverage detected