feat: chunked bge embeddings + lancedb sutta index
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
14
tests/test_index.py
Normal file
14
tests/test_index.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from buddhagpt.index import chunk_text
|
||||
|
||||
|
||||
def test_chunk_text_respects_max_words():
|
||||
text = " ".join(f"w{i}" for i in range(700))
|
||||
chunks = chunk_text(text, max_words=300, overlap=50)
|
||||
assert all(len(c.split()) <= 300 for c in chunks)
|
||||
assert len(chunks) == 3
|
||||
|
||||
|
||||
def test_chunks_overlap():
|
||||
text = " ".join(f"w{i}" for i in range(400))
|
||||
a, b = chunk_text(text, max_words=300, overlap=50)
|
||||
assert a.split()[-50:] == b.split()[:50]
|
||||
Reference in New Issue
Block a user