Fourteen corpora split and classified: aesop, bierce, chekhov, holmes, keefe, lawson, lorimer, maupassant, nobody, plaintales, poe, torchy, wallingford and winesburg, each with its splitter and the hand-written groups and pages; catalogue v2 and v3; and the shared splitters gutenberg_chunks.py, se_split.py and se_build.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019rwKTmug58sEsJ72AuWsEi
14 lines
509 B
Python
14 lines
509 B
Python
#!/usr/bin/env python3
|
|
"""Print a range of scenes for reading. Usage: dump.py <first_chunk> <last_chunk>"""
|
|
import json, sys
|
|
chunks = json.load(open(__file__.rsplit('/',1)[0] + '/chunks.json'))
|
|
a, b = int(sys.argv[1]), int(sys.argv[2])
|
|
cur = None
|
|
for i in range(a, min(b + 1, len(chunks))):
|
|
c = chunks[i]
|
|
if c['story'] != cur:
|
|
cur = c['story']
|
|
print(f"\n########## STORY {cur}: {c['title']} ##########")
|
|
print(f"\n----- scene {i} (story {cur}) -----")
|
|
print(c['text'].strip())
|