From 4a66aff86409069340998d48328c8f2f1dbb4ca5 Mon Sep 17 00:00:00 2001 From: guoyongzhi Date: Thu, 27 Jul 2023 15:29:22 +0800 Subject: [PATCH] add example languages --- Project.toml | 2 +- examples/languages.jl | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 examples/languages.jl diff --git a/Project.toml b/Project.toml index fbf1e51..922c845 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "WordCloud" uuid = "6385f0a0-cb03-45b6-9089-4e0acc74b26b" authors = ["guoyongzhi "] -version = "0.12.1" +version = "0.12.2" [deps] ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" diff --git a/examples/languages.jl b/examples/languages.jl new file mode 100644 index 0000000..835f9a6 --- /dev/null +++ b/examples/languages.jl @@ -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) \ No newline at end of file