Documentation ¶
Overview ¶
Package anagrammer uses a DAWG instead of a GADDAG to simplify the algorithm and make it potentially faster - we don't need a GADDAG to generate anagrams/subanagrams.
This package generates anagrams and subanagrams and has an RPC interface.
Index ¶
Constants ¶
View Source
const BlankPos = alphabet.MaxAlphabetSize
Variables ¶
View Source
var Dawgs map[string]*dawgInfo
Functions ¶
func Anagram ¶
func Anagram(letters string, d *gaddag.SimpleDawg, mode AnagramMode) []string
Types ¶
type AnagramMode ¶
type AnagramMode int
const ( ModeBuild AnagramMode = iota ModeExact ModePattern )
type AnagramStruct ¶
type AnagramStruct struct {
// contains filtered or unexported fields
}
type RackWrapper ¶
type RackWrapper struct {
// contains filtered or unexported fields
}
RackWrapper wraps an alphabet.Rack and adds helper data structures to make it usable for anagramming.
Click to show internal directories.
Click to hide internal directories.