Golang implementation of text cloud algorithm

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Golang version of the text cloud algorithm implementation

Project links

Https://github.com/bangbaoshi/wordcloud

The test steps are as follows

git clone https://github.com/bangbaoshi/wordcloud.gitcd wordcloudgo run boot/main.go

Create a text cloud picture in the IMGs directory with the above three steps (view imgs/out.png)

Catalogue Introduction

    1. The boot directory contains test cases
    2. Fonts directory contains several fonts (non-commercial use)
    3. IMGs Catalog contains template pictures, text clouds generated by the template image as a result of the appearance of

Instructions for use

The use method has been briefly introduced in the Boot/main.go

package mainimport ("image/color""github.com/bangbaoshi/wordcloud")func renderNow() {//需要写入的文本数组textList := []string{"恭喜", "发财", "万事", "如意"}//文本角度数组angles := []int{0, 15, -15, 90}//文本颜色数组colors := []*color.RGBA{&color.RGBA{0x0, 0x60, 0x30, 0xff},&color.RGBA{0x60, 0x0, 0x0, 0xff},&color.RGBA{0x73, 0x73, 0x0, 0xff},}//设置对应的字体路径,和输出路径render := wordcloud_go.NewWordCloudRender(60, 8,"./fonts/xin_shi_gu_yin.ttf","./imgs/tiger.png", textList, angles, colors, "./imgs/out.png")//开始渲染render.Render()}func main() {renderNow()}

Project Introduction

    1. Text cloud algorithm implemented using Golang language
    2. Use Golang to realize some interesting ideas

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.