From 1d66ab750f559e1d8880184e052872884438709f Mon Sep 17 00:00:00 2001 From: guo-yong-zhi <55872791+guo-yong-zhi@users.noreply.github.com> Date: Tue, 28 Dec 2021 23:58:11 +0800 Subject: [PATCH] test long word --- README.md | 2 +- test/runtests.jl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 14abb1f..98048de 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ stopwords = WordCloud.stopwords_en ∪ ["said"] textfile = pkgdir(WordCloud)*"/res/alice.txt" maskfile = pkgdir(WordCloud)*"/res/alice_mask.png" wc = wordcloud( -    processtext(open(textfile), stopwords=stopwords), +    processtext(open(textfile), stopwords=stopwords, maxnum=500),     mask = maskfile,     maskcolor="#faeef8",     outline = 4, diff --git a/test/runtests.jl b/test/runtests.jl index 4da6ca0..0d43598 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -15,12 +15,12 @@ include("test_textprocessing.jl") paint(wc) paint(wc, "test.jpg", background=outline(wc.mask, color=(1, 0, 0.2, 0.7), linewidth=2), ratio=0.5) paint(wc, "test.svg") + show(wc) @test getparameter(wc, :contentarea) == WordCloud.occupying(WordCloud.QTrees.kernel(wc.maskqtree[1]), WordCloud.QTrees.FULL) # animation setpositions!(wc, :, (-1000,-1000)) @record "animation1-test" filter=i->i%(2^(i÷100+3))==0 overwrite=true placewords!(wc, style=:gathering) @record outputdir="animation2-test" filter=i->i%10==0 overwrite=true generate!(wc, 100) - show(wc) # placewords! placewords!(wc, style=:gathering) @@ -32,7 +32,9 @@ include("test_textprocessing.jl") end # wordcloud factory - wc = wordcloud(["singleword" => 12], mask=shape(box, 200, 150, cornerradius=40, color=0.15), density=0.45, state=generate!) # singleword & Pair + wc = wordcloud(["singleword" => 12], mask=star, masksize=100, density=0.55, state=generate!) # singleword & Pair + wc = wordcloud([("loooooooooongword", 42)], mask=shape(box, 200, 150, cornerradius=40, color=0.15), density=0.55) + wc = wordcloud("giving a single word is ok. giving several words is ok too", mask=shape(squircle, 200, 150, color=0.15, rt=2.2), density=0.45, transparent=(1, 1, 1, 0)) # String & small mask @test_throws AssertionError wordcloud(["1"], [2,3], density=0.1) |> generate! # length unmatch