tool

package
v0.0.0-...-92c577d Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSimplified

func GetSimplified(index int) int32

func GetTraditional

func GetTraditional(index int) int32

Types

type BaseSearchEx

type BaseSearchEx struct {
	I_keywords []string
	I_guides   [][]int
	I_key      []int
	I_next     []int
	I_check    []int
	I_dict     []int
	Mongo      *mongo.Database
}

func (*BaseSearchEx) CreateDict

func (this *BaseSearchEx) CreateDict(keywords []string) int

func (*BaseSearchEx) Load

func (this *BaseSearchEx) Load(filename string)

func (*BaseSearchEx) Load2

func (this *BaseSearchEx) Load2(f *os.File)

func (*BaseSearchEx) Save

func (this *BaseSearchEx) Save(filename string)

func (*BaseSearchEx) Save2

func (this *BaseSearchEx) Save2(f *os.File)

func (*BaseSearchEx) SetKeywords

func (this *BaseSearchEx) SetKeywords(keywords []string)

type TrieNode

type TrieNode struct {
	Index    int
	Layer    int
	End      bool
	Char     int
	Results  []int
	M_values map[int]*TrieNode
	Failure  *TrieNode
	Parent   *TrieNode
}

func NewTrieNode

func NewTrieNode() *TrieNode

func (*TrieNode) Add

func (this *TrieNode) Add(c int) *TrieNode

func (*TrieNode) SetResults

func (this *TrieNode) SetResults(text int)

type TrieNode2

type TrieNode2 struct {
	End      bool
	Results  []int
	M_values map[int32]*TrieNode2
	// contains filtered or unexported fields
}

func NewTrieNode2

func NewTrieNode2() *TrieNode2

func (*TrieNode2) Add

func (this *TrieNode2) Add(c int32, node *TrieNode2)

func (*TrieNode2) HasKey

func (this *TrieNode2) HasKey(c int32) bool

func (*TrieNode2) SetResults

func (this *TrieNode2) SetResults(text int)

func (*TrieNode2) TryGetValue

func (this *TrieNode2) TryGetValue(c int32) (bool, *TrieNode2)

type TrieNodeEx

type TrieNodeEx struct {
	Parent       *TrieNodeEx
	Failure      *TrieNodeEx
	Char         int32
	End          bool
	Results      []int
	M_values     map[int32]*TrieNodeEx
	Merge_values map[int32]*TrieNodeEx

	Next  int
	Count int
	// contains filtered or unexported fields
}

func NewTrieNodeEx

func NewTrieNodeEx() *TrieNodeEx

func (*TrieNodeEx) Add

func (this *TrieNodeEx) Add(c int32) *TrieNodeEx

func (*TrieNodeEx) Merge

func (this *TrieNodeEx) Merge(node *TrieNodeEx)

func (*TrieNodeEx) Rank

func (this *TrieNodeEx) Rank(has []*TrieNodeEx) int

func (*TrieNodeEx) Rank2

func (this *TrieNodeEx) Rank2(start int, seats []bool, has []*TrieNodeEx) int

func (*TrieNodeEx) SetResults

func (this *TrieNodeEx) SetResults(text int)

func (*TrieNodeEx) SetSeats

func (this *TrieNodeEx) SetSeats(next int, seats []bool, has []*TrieNodeEx)

func (*TrieNodeEx) TryGetValue

func (this *TrieNodeEx) TryGetValue(c int32) (bool, *TrieNodeEx)

type TrieNodes

type TrieNodes struct {
	Items []*TrieNode
}

func NewTrieNodes

func NewTrieNodes() *TrieNodes

Jump to

Keyboard shortcuts

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