Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
ml6team
/
Knowledge-graphs
like
55
Build error
App
Files
Files
Community
1
refs/pr/1
Knowledge-graphs
/
utils.py
khaerens
updated to singletons
b40f434
over 1 year ago
raw
Copy download link
history
blame
Safe
218 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