fix: collection field extraction and add regression tests for sort-key and nested layout
This commit is contained in:
@@ -23,9 +23,11 @@ def load_bilara_suttas(root: Path) -> Iterator[dict]:
|
||||
segments = json.loads(f.read_text())
|
||||
uid = f.name.split("_")[0]
|
||||
title = next(iter(segments.values()), uid)
|
||||
# Derive collection from first directory under sutta/ (e.g., an, dn, kn, mn, sn)
|
||||
collection = f.relative_to(base).parts[0]
|
||||
yield {
|
||||
"uid": uid,
|
||||
"title": title.strip(),
|
||||
"text": segments_to_text(segments),
|
||||
"collection": f.parent.name,
|
||||
"collection": collection,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user