tools

package
v0.0.0-...-d652b9b Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Seg     jiebago.Segmenter
	WordIds map[uint64]int
)

Functions

func HandleError

func HandleError(msg string, err error)

func IDF

func IDF(word uint64, N int) float64

func Init

func Init()

func LoadWordIds

func LoadWordIds(path string)

func R

func R(tf int) float64

func ReadBytes

func ReadBytes(filename string) (data []byte, err error)

func ReadCsv

func ReadCsv(filepath string) [][]string

ReadCsv return [[url, text], ...]

func RemovePunctuation

func RemovePunctuation(str string) string

RemovePunctuation 移除所有的标点符号

func RemoveSpace

func RemoveSpace(str string) string

RemoveSpace 移除所有的空格

func Set

func Set(ids []uint32) []uint32

func Str2Uint64

func Str2Uint64(str string) uint64

func U32ToBytes

func U32ToBytes(key uint32) []byte

func U64ToBytes

func U64ToBytes(key uint64) []byte

func WordCut

func WordCut(q string) (res []string)

func WordCutForInv

func WordCutForInv(q string) []string

func WriteBytes

func WriteBytes(data []byte, filename string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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