util

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Normalize

func Normalize(word string, reg *stopwords.Register) (string, bool)

Normalize sanitizes word and tells whether it is allowed token or not.

func Sanitize

func Sanitize(strs [][]byte, reg *stopwords.Register) []string

Sanitize ...

func SortTagItems

func SortTagItems(items []*model.Tag)

SortTagItems sorts items by score in descending order, if scores are equal it sorts by count if counts are equal, it sorts string values alphabetically.

func SplitToSentences

func SplitToSentences(text []byte) [][]byte

SplitToSentences splits given text into slice of sentences.

func SplitToTokens added in v0.59.0

func SplitToTokens(text []byte, cfg *config.Config) []string

func TFIDF

func TFIDF(t *model.Tag) float64

TFIDF applies TF-IDF to given Tag

func UpdateControlStr added in v0.59.0

func UpdateControlStr(candidate, control string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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