Knowledge-graphs / utils.py
khaerens's picture
update
b4f3ba3
raw
history blame
No virus
212 Bytes
def clip_text(t, lenght = 4):
t_sub = t.replace("...", "dotdotdot")
t_clipped = ".".join(t_sub.split(".")[:lenght]) + "."
t_reverted = t_clipped.replace("dotdotdot", "...")
return t_reverted