Skip to content

Commit f7cd422

Browse files
authored
Merge pull request #257 from ericphanson/patch-1
fix string indexing in `summary`
2 parents f3ae819 + f4df4fd commit f7cd422

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/show.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function Base.summary(d::AbstractDocument)
1313
if typeof(d) <: Union{TokenDocument, NGramDocument}
1414
o *= " * Snippet: ***SAMPLE TEXT NOT AVAILABLE***"
1515
else
16-
sample_text = replace(text(d)[1:min(50, length(text(d)))], r"\s+" => " ")
16+
sample_text = replace(first(text(d), 50), r"\s+" => " ")
1717
o *= " * Snippet: $(sample_text)"
1818
end
1919
return o

0 commit comments

Comments
 (0)