Corin1998 commited on
Commit
4db6bc3
·
verified ·
1 Parent(s): 72d36d9

Create _text.py

Browse files
Files changed (1) hide show
  1. rag/_text.py +5 -0
rag/_text.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ import re
2
+
3
+ def clean_text(t: str) -> str:
4
+ t = re.sub(r"\s+"," ",t or " ").strip()
5
+ return t