Skip to content

Commit

Permalink
Merge pull request #257 from ericphanson/patch-1
Browse files Browse the repository at this point in the history
fix string indexing in `summary`
  • Loading branch information
aviks committed Jun 25, 2021
2 parents f3ae819 + f4df4fd commit f7cd422
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Base.summary(d::AbstractDocument)
if typeof(d) <: Union{TokenDocument, NGramDocument}
o *= " * Snippet: ***SAMPLE TEXT NOT AVAILABLE***"
else
sample_text = replace(text(d)[1:min(50, length(text(d)))], r"\s+" => " ")
sample_text = replace(first(text(d), 50), r"\s+" => " ")
o *= " * Snippet: $(sample_text)"
end
return o
Expand Down

0 comments on commit f7cd422

Please sign in to comment.