-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
guoyongzhi
committed
Jan 7, 2021
1 parent
042051f
commit e2cd980
Showing
11 changed files
with
233 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "WordCloud" | ||
uuid = "6385f0a0-cb03-45b6-9089-4e0acc74b26b" | ||
authors = ["guoyongzhi <[email protected]>"] | ||
version = "0.2.6" | ||
version = "0.3.0" | ||
|
||
[deps] | ||
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using WordCloud | ||
using Random | ||
|
||
println("This test may take several minutes") | ||
|
||
words = [Random.randstring(rand(1:8)) for i in 1:200] | ||
weights = randexp(length(words)) .* 2000 .+ rand(20:100, length(words)); | ||
wc1 = wordcloud(words, weights, mask=shape(ellipse, 500, 500, color=0.15), angles=(0,90,45), fillingrate=0.7) | ||
|
||
words = [Random.randstring(rand(1:8)) for i in 1:500] | ||
weights = randexp(length(words)) .* 2000 .+ rand(20:100, length(words)); | ||
wc2 = wordcloud(words, weights, mask=shape(ellipse, 500, 500, color=0.15), angles=(0,90,45)) | ||
|
||
words = [Random.randstring(rand(1:8)) for i in 1:5000] | ||
weights = randexp(length(words)) .* 2000 .+ rand(20:100, length(words)); | ||
wc3 = wordcloud(words, weights, mask=shape(box, 2000, 2000, 100, color=0.15), angles=(0,90,45)) | ||
|
||
wcs = [wc1, wc1, wc2, wc3] #repeat wc1 to trigger compiling | ||
ts = [WordCloud.trainepoch_E!,WordCloud.trainepoch_EM!,WordCloud.trainepoch_EM2!, | ||
WordCloud.trainepoch_P!,WordCloud.trainepoch_P2!,WordCloud.trainepoch_level!] | ||
for (i,wc) in enumerate(wcs) | ||
println("\n\n", "*"^10, "wordcloud - $(length(wc.words)) words on mask$(size(wc.mask))", "*"^10) | ||
for (j,t) in enumerate(ts) | ||
println("\n", i-1, "==== ", j, "/", length(ts), " ", nameof(t)) | ||
placement!(wc) | ||
@time generate!(wc, trainer=t, retry=1) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.