Skip to content

Commit

Permalink
fix process arg type
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyongzhi committed Dec 28, 2020
1 parent 793217d commit 8222fbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ end
# counter
# end

function process(counter::Dict{String,Number};
function process(counter::Dict{String,<:Number};
stopwords=stopwords_en,
minlength=2, maxlength=30,
minfrequency=0,
Expand Down
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include("test_lru.jl")
end

@testset "WordCloud.jl" begin
# @show pwd()
img, img_m = WordCloud.rendertext("test", 88.3, color="blue", angle = 20, border=1, returnmask=true)
words = [Random.randstring(rand(1:8)) for i in 1:rand(100:1000)]
weights = randexp(length(words)) .* 1000 .+ randexp(length(words)) .* 200 .+ rand(20:100, length(words));
Expand All @@ -30,5 +31,11 @@ end
wordcloud(process("giving a single word is ok. giving several words is ok too"),
maskimg=shape(box, 20, 15, 0, color=0.15), filling_rate=0.5, transparentcolor=(1,1,1,0)) #String & small mask
placement!(wc)
wc = wordcloud(
process(open("../res/alice.txt"), stopwords=WordCloud.stopwords_en ["said"]),
mask = loadmask("../res/alice_mask.png", color="#faeef8", backgroundcolor=0.97),
colors = (WordCloud.colorschemes[:Set1_5].colors..., ),
angles = (0, 90),
filling_rate = 0.55);
end

0 comments on commit 8222fbe

Please sign in to comment.