khaerens commited on
Commit
b4f3ba3
1 Parent(s): 9aba575
Files changed (1) hide show
  1. utils.py +6 -2
utils.py CHANGED
@@ -1,2 +1,6 @@
1
- def clip_text(t, lenght = 3):
2
- return ".".join(t.split(".")[:lenght]) + "."
 
 
 
 
 
1
+
2
+ def clip_text(t, lenght = 4):
3
+ t_sub = t.replace("...", "dotdotdot")
4
+ t_clipped = ".".join(t_sub.split(".")[:lenght]) + "."
5
+ t_reverted = t_clipped.replace("dotdotdot", "...")
6
+ return t_reverted