jieba

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseDictName    = "dict.txt"
	UserDictDirName = "user"
	BaseProbName    = "prob_emit.txt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HmmSeg

type HmmSeg interface {
	Cut(statement []rune) []string
}

type Keyword added in v0.0.2

type Keyword struct {
	Word       string
	TfidfValue float64
}

func (*Keyword) String added in v0.0.2

func (kw *Keyword) String() string

type ModeStyle

type ModeStyle int
const ModeIndex ModeStyle = 1
const ModeSearch ModeStyle = 0

type SegToken

type SegToken struct {
	Word  string
	Start int
	End   int
}

func (*SegToken) String

func (st *SegToken) String() string

type Segment

type Segment struct {
	Start int
	End   int
}

func (*Segment) ToString

func (seg *Segment) ToString(sentence []rune) string

type SegmentHandler

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

func MewSegmentHandler

func MewSegmentHandler(dictRootPath string) (*SegmentHandler, error)

func (*SegmentHandler) SegParagraph

func (h *SegmentHandler) SegParagraph(s string, mode ModeStyle) []*SegToken

type Tfidf added in v0.0.2

type Tfidf interface {
	TopN(input []rune, n int) []*Keyword
	TopNByString(input string, n int) []*Keyword
}

func NewTfidf added in v0.0.2

func NewTfidf(rootPath string, segHandler *SegmentHandler) (Tfidf, error)

type Trie

type Trie interface {
	Match(sentence []rune) []*Segment
	ExistShortWord(word string) bool
}

Jump to

Keyboard shortcuts

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