diff --git a/wizard-work/spark/text_stats.py b/wizard-work/spark/text_stats.py index d782ebd..432a993 100644 --- a/wizard-work/spark/text_stats.py +++ b/wizard-work/spark/text_stats.py @@ -10,7 +10,7 @@ def analyze_text(filepath): try: with open(filepath, 'r', encoding='utf-8', errors='replace') as f: content = f.read() - lines = len(content.splitlines()) + lines = content.count('\n') words = len(content.split()) chars = len(content) return lines, words, chars