util

package
v0.56.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: Apache-2.0 Imports: 8 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 TFIDF

func TFIDF(t *model.Tag) float64

TFIDF applies TF-IDF to given Tag

Types

This section is empty.

Jump to

Keyboard shortcuts

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