Skip to content

Commit

Permalink
test long word
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yong-zhi committed Dec 28, 2021
1 parent 21fe037 commit 1d66ab7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

2 comments on commit 1d66ab7

@guo-yong-zhi
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/51346

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.4 -m "<description of version>" 1d66ab750f559e1d8880184e052872884438709f
git push origin v0.9.4

Please sign in to comment.