File: //opt/textanalyse/utils/text_helpers.py
# utils/text_helpers.py
import re
def clean_text(text: str) -> str:
"""Basic text cleaning function."""
text = text.strip()
# Add more cleaning steps as needed (e.g., normalize whitespace)
return text
def split_into_words(text: str) -> list[str]:
"""Splits text into words, removing basic punctuation."""
if not text:
return []
# Remove punctuation and split
text = re.sub(r'[^\w\s]', '', text)
words = text.lower().split()
return words
# Add other helper functions relevant to proofreading tasks