import json, re a = open('output/article.md', encoding='utf-8').read() body = '\n'.join(l for l in a.splitlines() if not l.startswith('# ')) body_text = re.sub(r'^#+\s*', '', body, flags=re.M) print('body words (excl H1, incl subheads):', len(body_text.split())) m = json.load(open('output/metadata.json', encoding='utf-8')) print('headline chars:', len(m['headline'])) print('excerpt words:', len(m['excerpt'].split())) print('search desc chars:', len(m['search_description'])) print('H1 matches headline:', a.splitlines()[0][2:] == m['headline']) for bad in ['19', 'GDPR', 'offline', 'hallucination', '60%', 'fired', 'I tested', 'we tested']: print(bad, bad in a)