Documentation ¶
Overview ¶
Package trie :: nodeStack.go
Package trie :: runePhases.go
Package trie :: runeTrie.go
Package trie :: runeTrieNodeStack.go
Package trie :: trie.go
Index ¶
- type Node
- func (n *Node) Add(k string) *Node
- func (n *Node) Contains(k string) bool
- func (n *Node) Equals(p *Node) bool
- func (n *Node) GetChildNode(k string) *Node
- func (n *Node) GetChildren() map[string]*Node
- func (n *Node) GetChildrenKeys() []string
- func (n *Node) GetChildrenNodes() []*Node
- func (n *Node) GetContent() string
- func (n *Node) IsContent(k string) bool
- func (n *Node) IsEnd() bool
- func (n *Node) String() string
- type NodeItem
- type NodeStack
- type RunePhases
- type RuneTrie
- type RuneTrieNode
- func (n *RuneTrieNode) Add(k rune) *RuneTrieNode
- func (n *RuneTrieNode) Contains(k rune) bool
- func (n *RuneTrieNode) Equals(p *RuneTrieNode) bool
- func (n *RuneTrieNode) GetChildNode(k rune) *RuneTrieNode
- func (n *RuneTrieNode) GetChildren() map[rune]*RuneTrieNode
- func (n *RuneTrieNode) GetChildrenKeys() []rune
- func (n *RuneTrieNode) GetChildrenNodes() []*RuneTrieNode
- func (n *RuneTrieNode) GetContent() rune
- func (n *RuneTrieNode) IsContent(k rune) bool
- func (n *RuneTrieNode) IsEnd() bool
- func (n *RuneTrieNode) String() string
- type RuneTrieNodeItem
- type RuneTrieStack
- type Trie
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node struct
func (*Node) GetChildNode ¶
GetChildNode is a Node pointer receiver to get a node by key
func (*Node) GetChildren ¶
GetChildren is a Node pointer method receiver to get node's children
func (*Node) GetChildrenKeys ¶
GetChildrenKeys is a Node pointer receiver to get children's keys
func (*Node) GetChildrenNodes ¶
GetChildrenNodes is a Node pointer receiver to get children's nodes
func (*Node) GetContent ¶
GetContent is a Node pointer method receiver to get content of the node
type NodeStack ¶
type NodeStack struct {
// contains filtered or unexported fields
}
NodeStack struct
type RunePhases ¶
type RunePhases []string
RunePhases type
func (RunePhases) Len ¶
func (rs RunePhases) Len() int
Len implements Len() in sort.Interface for RunePhases
func (RunePhases) Less ¶
func (rs RunePhases) Less(x, y int) bool
Less implements Less() in sort.Interface for RunePhases
func (RunePhases) Swap ¶
func (rs RunePhases) Swap(x, y int)
Swap implements Swap() in sort.Interface for RunePhases
type RuneTrie ¶
type RuneTrie struct {
// contains filtered or unexported fields
}
RuneTrie struct
func NewRuneTrie ¶
NewRuneTrie constructs a RuneTrie with specific end and returns its pointer
func (*RuneTrie) FindMatchedPhases ¶
FindMatchedPhases returns a list of phases match the prefix
type RuneTrieNode ¶
type RuneTrieNode struct {
// contains filtered or unexported fields
}
RuneTrieNode struct
func NewRuneTrieNode ¶
func NewRuneTrieNode(k rune) *RuneTrieNode
NewRuneTrieNode constructs a RuneTrieNode and return its pointer
func (*RuneTrieNode) Add ¶
func (n *RuneTrieNode) Add(k rune) *RuneTrieNode
Add is a RuneTrieNode pointer receiver to add a new RuneTrieNode to children
func (*RuneTrieNode) Contains ¶
func (n *RuneTrieNode) Contains(k rune) bool
Contains is a RuneTrieNode pointer receiver to check if a child key exists
func (*RuneTrieNode) Equals ¶
func (n *RuneTrieNode) Equals(p *RuneTrieNode) bool
Equals checks if two nodes have the same content
func (*RuneTrieNode) GetChildNode ¶
func (n *RuneTrieNode) GetChildNode(k rune) *RuneTrieNode
GetChildNode is a RuneTrieNode pointer receiver to get a node by key
func (*RuneTrieNode) GetChildren ¶
func (n *RuneTrieNode) GetChildren() map[rune]*RuneTrieNode
GetChildren is a RuneTrieNode pointer method receiver to get node's children
func (*RuneTrieNode) GetChildrenKeys ¶
func (n *RuneTrieNode) GetChildrenKeys() []rune
GetChildrenKeys is a RuneTrieNode pointer receiver to get children's keys
func (*RuneTrieNode) GetChildrenNodes ¶
func (n *RuneTrieNode) GetChildrenNodes() []*RuneTrieNode
GetChildrenNodes is a RuneTrieNode pointer receiver to get children's nodes
func (*RuneTrieNode) GetContent ¶
func (n *RuneTrieNode) GetContent() rune
GetContent is a RuneTrieNode pointer method receiver to get content of the node
func (*RuneTrieNode) IsContent ¶
func (n *RuneTrieNode) IsContent(k rune) bool
IsContent func returns true if the node content is as same as specified rune; otherwise, false
func (*RuneTrieNode) IsEnd ¶
func (n *RuneTrieNode) IsEnd() bool
IsEnd checks if the node is the phase end
type RuneTrieNodeItem ¶
type RuneTrieNodeItem struct {
// contains filtered or unexported fields
}
RuneTrieNodeItem struct
func (*RuneTrieNodeItem) String ¶
func (e *RuneTrieNodeItem) String() string
String func for RuneTrieItem
type RuneTrieStack ¶
type RuneTrieStack struct {
// contains filtered or unexported fields
}
RuneTrieStack struct
func (*RuneTrieStack) Peek ¶
func (s *RuneTrieStack) Peek() *RuneTrieNodeItem
Peek is a pointer method receiver for RuneTrieStack to peek the top item
func (*RuneTrieStack) Pop ¶
func (s *RuneTrieStack) Pop() *RuneTrieNodeItem
Pop is a pointer method receiver for RuneTrieStack to pop the top item
func (*RuneTrieStack) Push ¶
func (s *RuneTrieStack) Push(p *RuneTrieNodeItem)
Push is a pointer method receiver for RuneTrieStack to push into the stack
func (*RuneTrieStack) Size ¶
func (s *RuneTrieStack) Size() int
Size is a pointer method receiver for RuneTrieStack to return the stack size
func (*RuneTrieStack) String ¶
func (s *RuneTrieStack) String() string
String func for RuneTrieStack
type Trie ¶
type Trie struct {
// contains filtered or unexported fields
}
Trie struct
func NewTrie ¶
func NewTrie() *Trie
NewTrie constructs a Trie with specific end and returns its pointer
func (*Trie) FindMatchedPhases ¶
FindMatchedPhases returns a list of phases match the prefix