File: //opt/textanalyse/tools/segmentation_tool.py
# tools/segmentation_tool.py
"""
Segmentation-Tool für deutsche Texte.
Teilt einen Text in Sätze auf und liefert eine Liste von Strings.
"""
from functools import lru_cache
# Disabled spacy/numpy import due to compatibility issues
# import spacy
# @lru_cache
# def _load_spacy(model: str = "de_core_news_sm"):
# try:
# return spacy.load(model)
# except OSError:
# from spacy.cli import download
#
# download(model)
# return spacy.load(model)
#
# nlp = _load_spacy()
nlp = None
def split_sentences(text: str) -> list[str]:
"""
Dummy: Gibt den gesamten Text als einzelnes Segment zurück.
"""
return [text]