diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b16b059 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020, vaaaaanquish + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 30827c1..afdc2f8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,48 @@ # Cloudia Tools to easily create a word cloud. +### from string +``` +from cloudia import Cloudia + +text = "text data" +Cloudia(text).plot() +``` + +![sample_img](https://github.com/vaaaaanquish/cloudia/blob/021a6d151fb6a3b579dc96b7086356fc0c225852/examples/img/sample_img.png?raw=true, "sample_img") + +from : [20 Newsgroups](http://qwone.com/~jason/20Newsgroups/) + + +### from pandas +``` +df = pd.DataFrame({'wc1': ['sample1','sample2'], 'wc2': ['hoge hoge piyo piyo fuga', 'hoge']}) + +# plot from df +Cloudia(df).plot() + +# add df method +df.wc.plot(dark_theme=True) +``` + +![pandas_img](https://github.com/vaaaaanquish/cloudia/blob/021a6d151fb6a3b579dc96b7086356fc0c225852/examples/img/pandas_img.png?raw=true, "pandas_img") +![dark_img](https://github.com/vaaaaanquish/cloudia/blob/021a6d151fb6a3b579dc96b7086356fc0c225852/examples/img/dark_img.png?raw=true, "dark_img") + +from pandas.DataFrame or pandas.Series. + + +### from japanese +``` +text = "これはCloudiaのテストです。WordCloudをつくるには本来、形態素解析の導入が必要になります。Cloudiaはmecabのような形態素解析器の導入は必要はなくnagisaを利用した動的な生成を行う事ができます。nagisaとjapanize-matplotlibは、形態素解析を必要としてきたWordCloud生成に対して、Cloudiaに対して大きく貢献しました。ここに感謝の意を述べたいと思います。" + +Cloudia(text).plot() +``` + +![japanese_img](https://github.com/vaaaaanquish/cloudia/blob/021a6d151fb6a3b579dc96b7086356fc0c225852/examples/img/japanese_img.png?raw=true, "jap_img") + +from japanese without morphological analysis module + + # Require I'm waiting for this [PR](https://github.com/uehara1414/japanize-matplotlib/pull/9). diff --git a/examples/img/dark_img.png b/examples/img/dark_img.png new file mode 100644 index 0000000..16e8bd0 Binary files /dev/null and b/examples/img/dark_img.png differ diff --git a/examples/img/japanese_img.png b/examples/img/japanese_img.png new file mode 100644 index 0000000..bf73fce Binary files /dev/null and b/examples/img/japanese_img.png differ diff --git a/examples/img/pandas_img.png b/examples/img/pandas_img.png new file mode 100644 index 0000000..8d039f7 Binary files /dev/null and b/examples/img/pandas_img.png differ diff --git a/examples/img/sample_img.png b/examples/img/sample_img.png new file mode 100644 index 0000000..ea8c92d Binary files /dev/null and b/examples/img/sample_img.png differ