INNER CODE UNIT · Python
content_start
voocel/ainovel-cli · scripts/check_chapter_wordcount.py:40
content_start = i + 1
break
return '\n'.join(lines[content_start:])
def check_chapter(file_path: str, min_words: int = 3000) -> dict:
"""检查单个章节的字数"""
path = Path(file_path)
if not path.exists():
return {
'file': str(path),
'exists': False,
'word_count': 0,
'status': 'error',
'message': f'文件不存在: {file_path}',
}