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
Fetching metadata from the HF Docker repository...
abf6849
Knowledge-graphs
/
utils.py
khaerens
update
b4f3ba3
almost 3 years ago
raw
Copy download link
history
blame
Safe
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