Skip to content

Commit

Permalink
add example languages
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yong-zhi committed Jul 31, 2023
1 parent df5b461 commit 4a66aff
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
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.12.1"
version = "0.12.2"

[deps]
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Expand Down
38 changes: 38 additions & 0 deletions examples/languages.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#md# WordCloud.jl can process English text. For Chinese text, please refer to the example [`中文`](#中文). For other languages, you can input the data in the form of "word => weight" list, as shown in the example below.
using WordCloud
words_weights = [
"普通话" => 939.0,
"Español" => 485.0,
"English" => 380.0,
"हिन्दी" => 345.0,
"Português" => 236.0,
"বাংলা" => 234.0,
"Русский" => 147.0,
"日本語" => 123.0,
"粤语" => 86.1,
"Tiếng Việt" => 85.0,
"Türkçe" => 84.0,
"吴语" => 83.4,
"मराठी" => 83.2,
"తెలుగు" => 83.0,
"한국어" => 81.7,
"Français" => 80.8,
"தமிழ்" => 78.6,
"مصري" => 77.4,
"Deutsch" => 75.3,
"اردو" => 70.6,
"ꦧꦱꦗꦮ" => 68.3,
"پنجابی" => 66.7,
"Italiano" => 64.6,
"فارسی" => 57.2,
"ગુજરાતી" => 57.1,
"भोजपुरी" => 52.3,
"هَوْسَ" => 51.7
]
wc = wordcloud(words_weights) |> generate!

println("results are saved to languages.svg")
paint(wc, "languages.svg")
wc
#eval# runexample(:languages)
#md# ![](languages.svg)

0 comments on commit 4a66aff

Please sign in to comment.