sec08 stage 0: RAW normalized (multi-author fixes), xref parser patch (4 authors), INDEX (46 items: 41 NEW + 5 xref)

- RAW: Mahler/Pine/Stone 1975 vs Stone/Church 1968 (2 separate books), Grossmann×2/Waters
  joined; xref.py AUTHOR_LINE now supports up to 4 author groups + continuation-year lines
- xref map: 51 raw entries → 46 unique books (5 B-list duplicates merged); 5 xrefs
  (CW8→sec01#03, CW9/I→sec01#04, CW17→sec02#09, Wilkinson→sec01#55, Children's Dreams→sec02#11)
- largest section so far (46 vs 28 sec06)
This commit is contained in:
Dmitry Kokorin 2026-09-26 16:23:05 +03:00
parent 8bcd745039
commit 285b485377
4 changed files with 242 additions and 34 deletions

View file

@ -48,7 +48,7 @@ AUTHOR_LINE = re.compile(
r'^(\s{0,8})'
r'([A-Z][A-Za-z\u00C0-\u017F\-]+)' # 2: surname
r'(?:\s*,\s*[A-Za-z.\-](?:\s?[A-Za-z.\-]){0,8})?' # initials blob ", C. A."
r'(?:\s*,\s*[A-Z][A-Za-z\u00C0-\u017F\-]+\s*,\s*[A-Za-z.\-](?:\s?[A-Za-z.\-]){0,8})?' # ", Surname, I."
r'(?:\s*,\s*[A-Z][A-Za-z\u00C0-\u017F\-]+\s*,\s*[A-Za-z.\-](?:\s?[A-Za-z.\-]){0,8}){0,3}' # ", Surname, I." x3
r'\s*,?'
r'\s{2,}(\S.*)$')
CONT_AUTHOR = re.compile(r'^\s{8,16}([A-Z]\.)\s*$') # lone initial (surname on prev line)
@ -94,6 +94,11 @@ def parse_raw(path):
cur['author'] += ', ' + m.group(2).strip().rstrip(',')
cur['title'] += ' ' + m.group(3)
continue
if cur and re.match(r'^\d{4}\.?\s*$', m.group(3).strip()):
# continuation author line: "Pine, F., 1975." (bib tail, no title)
cur['author'] += ', ' + m.group(2).strip().rstrip(',')
cur['title'] += ' ' + m.group(3).strip()
continue
flush()
author = m.group(2).strip().rstrip(',')
cur = {'cw': None, 'author': author, 'title': m.group(3), 'raw': stripped}
@ -293,7 +298,7 @@ def main():
raw_secs = {}
for sec, name, path in [
('07', 'Complexes & Association Experiment', 'sections/07-complexes/RAW.md'),
('08', 'Developmental Psychology', 'data/isap-raw/08-developmental-psychology.txt'),
('08', 'Developmental Psychology', 'sections/08-developmental/RAW.md'),
('09', 'Comparison of Psychodynamic Concepts', 'data/isap-raw/09-comparison-of-psychodynamic-concepts.txt'),
('10', 'Psychopathology & Psychiatry', 'data/isap-raw/10-psychopathology-psychiatry.txt'),
('11', 'The Individuation Process', 'data/isap-raw/11-individuation-process.txt'),