dict

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DictNode

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

func (*DictNode) AddWord

func (node *DictNode) AddWord(word, pos string)

func (*DictNode) IsParent

func (node *DictNode) IsParent() bool

func (*DictNode) Search

func (node *DictNode) Search(chars []rune, begin, length int, token *Token) *Token

func (*DictNode) StopWord

func (node *DictNode) StopWord(word, pos string)

type Dictionary

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

func New

func New() *Dictionary

func (*Dictionary) AddWord

func (dict *Dictionary) AddWord(word, pos string)

func (*Dictionary) AddWords

func (dict *Dictionary) AddWords(wordPairs [][]string)

func (*Dictionary) IsStopped

func (dict *Dictionary) IsStopped(chars []rune, begin, length int) bool

func (*Dictionary) SearchInMain

func (dict *Dictionary) SearchInMain(chars []rune, begin, length int) *Token

func (*Dictionary) SearchWithToken

func (dict *Dictionary) SearchWithToken(chars []rune, currentIndex int, token *Token) *Token

func (*Dictionary) StopWord

func (dict *Dictionary) StopWord(word, pos string)

func (*Dictionary) StopWords

func (dict *Dictionary) StopWords(wordPairs [][]string)

type Token

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

func (*Token) Begin

func (token *Token) Begin() int

func (*Token) End

func (token *Token) End() int

func (*Token) Equals

func (token *Token) Equals(other *Token) bool

func (*Token) GetPrefixNode

func (token *Token) GetPrefixNode() *DictNode

func (*Token) IsMatch

func (token *Token) IsMatch() bool

func (*Token) IsMismatch

func (token *Token) IsMismatch() bool

func (*Token) IsPrefix

func (token *Token) IsPrefix() bool

func (*Token) Pos

func (token *Token) Pos() string

func (*Token) SetBegin

func (token *Token) SetBegin(begin int)

func (*Token) SetEnd

func (token *Token) SetEnd(end int)

func (*Token) SetMatch

func (token *Token) SetMatch()

func (*Token) SetMismatch

func (token *Token) SetMismatch()

func (*Token) SetPos

func (token *Token) SetPos(pos string)

func (*Token) SetPrefix

func (token *Token) SetPrefix()

func (*Token) SetPrefixNode

func (token *Token) SetPrefixNode(node *DictNode)

Jump to

Keyboard shortcuts

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