util

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(word string, noStopWords bool) (string, bool)

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

func Sanitize

func Sanitize(strs [][]byte, noStopWords bool) []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