wordcloud

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = module.Module{
	ModuleName:    "word",
	ModuleVersion: "1.0.0",
	ModuleDepends: []string{
		"order",
	},
	ModuleEnv: map[string]any{
		"orm.model": []any{
			&OrderWord{},
			&GlobalWord{},
		},
	},
	ModuleExport: map[string]any{},
	ModulePerm: map[string]string{
		"word.view": "查看词云",
	},
	EntryPoint: entry,
}

Functions

This section is empty.

Types

type Filter

type Filter interface {
	IsLegal(word WordJson) bool
}

type FilterWithDict

type FilterWithDict struct {
	Dictionary map[string]any
}

func NewWordFilter

func NewWordFilter(dict map[string]any) *FilterWithDict

func (*FilterWithDict) Has

func (filter *FilterWithDict) Has(str string) bool

func (*FilterWithDict) IsLegal

func (filter *FilterWithDict) IsLegal(word WordJson) bool

type GlobalWord

type GlobalWord struct {
	Content   string `gorm:"primarykey; comment:词语"`
	WordClass string `gorm:"primarykey; comment:词性"`
	Count     uint   `gorm:"not null; index; default:0; comment:词频"`
}

type LengthFilter

type LengthFilter struct{}

func (*LengthFilter) IsLegal

func (lf *LengthFilter) IsLegal(word WordJson) bool

type OrderWord

type OrderWord struct {
	OrderID   uint        `gorm:"primarykey; comment:订单ID"`
	Order     order.Order `gorm:"foreignKey:OrderID"`
	Content   string      `gorm:"primarykey; comment:词语"`
	WordClass string      `gorm:"primarykey; comment:词性"`
	Count     uint        `gorm:"not null; index; default:0; comment:词频"`
}

type WordCollector

type WordCollector struct {
	// contains filtered or unexported fields
}

func NewWordCollectorWithSet

func NewWordCollectorWithSet(wordSet []WordJson) *WordCollector

func NewWordCollectorWithStr

func NewWordCollectorWithStr(str string) *WordCollector

func (*WordCollector) Filter

func (wc *WordCollector) Filter(filter Filter) *WordCollector

func (*WordCollector) ToSlice

func (wc *WordCollector) ToSlice() []WordJson

type WordJson

type WordJson struct {
	Content   string `json:"content"`
	WordClass string `json:"wordclass"`
	Count     uint   `json:"count"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL