Documentation
¶
Overview ¶
Package suffixtree implements suffix tree for clone detection. Core types: STree (tree), state (node), tran (edge), Match (duplicate), Token (interface). Algorithm: Build incrementally, FindDuplOver() searches for sequences >= threshold. Performance: O(n*m) worst case, typically O(n). Memory: O(n*k). Optimization: Map-based transition lookup for O(1) findTran performance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type STree ¶
type STree struct {
// contains filtered or unexported fields
}
STree is a struct representing a suffix tree.
func (*STree) FindDuplOver ¶
FindDuplOver find pairs of maximal duplicities over a threshold length.
type Token ¶
type Token interface {
Val() TokenValue
}
Token represents a token in the suffix tree sequence. Implementations must provide a TokenValue that uniquely identifies the token type.
type TokenValue ¶
type TokenValue int32
TokenValue represents a unique token identifier in the suffix tree. Uses int32 to keep memory pressure low while supporting large token sets.