nlp

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LanguageJapanese = "ja"
	LanguageEnglish  = "en"
)

Variables

This section is empty.

Functions

func RegisterTokenizer

func RegisterTokenizer(lang string, splitter func(string) []string, stemmer func(string) string, stopWords map[string]bool)

Types

type Token

type Token struct {
	Word      string
	Positions []uint32
}

type Tokenizer

type Tokenizer struct {
	// contains filtered or unexported fields
}

func FindTokenizer

func FindTokenizer(lang string) (*Tokenizer, error)

func (Tokenizer) StemWord

func (t Tokenizer) StemWord(word string) string

func (Tokenizer) Tokenize

func (t Tokenizer) Tokenize(content string, offset int) []*Token

func (Tokenizer) TokenizeToMap

func (t Tokenizer) TokenizeToMap(content string, offset int) (tokenMap map[string]*Token, wordCount int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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