util

package
v0.0.0-...-683a4be Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: GPL-3.0 Imports: 3 Imported by: 4

Documentation

Overview

Package util is where we place all utility funcs that can be used in every other packages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateWordSet

func CreateWordSet(words []string) map[string]int

CreateWordSet create a set of words from a slice of string

func GetEnv

func GetEnv(env string) string

GetEnv gets environment from given string

func SliceStringToInt64

func SliceStringToInt64(ss []string) []int64

SliceStringToInt64 converts a slice of string into a slice of int64

func StringToInt64

func StringToInt64(s string) int64

StringToInt64 convert a string into int64

func Tokenize

func Tokenize(s string, isUsingStopwordRemoval bool, stopwordSet map[string]int) map[string]int

tokenize is a tokenizer function, basically to remove punctuations and (optional) to remove stopwords to a document name or a search term

func WordsSetIntersection

func WordsSetIntersection(ma, mb map[string]int) map[string]int

WordsSetIntersection find the intersection between two sets (ma & mb)

func WordsSetSubtraction

func WordsSetSubtraction(ma, mb map[string]int) map[string]int

WordsSetSubtraction do a substraction between two sets ma - mb

func WordsSetUnion

func WordsSetUnion(ma, mb map[string]int) map[string]int

WordsSetUnion do a union from two given words sets

Types

This section is empty.

Jump to

Keyboard shortcuts

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