GPP1 / src /utils /text.py
Hitakshi26's picture
NotebookLM Clone
b4c7867
raw
history blame contribute delete
188 Bytes
import re
def safe_name(s: str) -> str:
s = (s or "").strip()
s = re.sub(r"[^a-zA-Z0-9_\- ]+", "", s)
s = re.sub(r"\s+", " ", s).strip()
return s[:60] if s else "Untitled"