Home | History | Annotate | Download | only in codewalk

Lines Matching defs:String

60 type Prefix []string
62 // String returns the Prefix as a string (for use as a map key).
63 func (p Prefix) String() string {
68 func (p Prefix) Shift(word string) {
74 // A prefix is a string of prefixLen words joined with spaces.
77 chain map[string][]string
83 return &Chain{make(map[string][]string), prefixLen}
92 var s string
96 key := p.String()
102 // Generate returns a string of at most n words generated from Chain.
103 func (c *Chain) Generate(n int) string {
105 var words []string
107 choices := c.chain[p.String()]