Beispiel #1
0
func (d *Dict) Inflate(s string) <-chan string {
	return inflator.Start(func(ch chan<- string) {
		d.Get(s, func(word string) bool {
			ch <- word
			return true
		})
	})
}
Beispiel #2
0
func (c *Converter) Inflate(s string) <-chan string {
	return inflator.Start(func(ch chan<- string) {
		c.convert2(s, func(core, remain string, n trie.Node) {
			extend := false
			if n != c.trie.Root() {
				recursive_each(n, func(m trie.Node) {
					if e, ok := m.Value().(*entry); ok && e.output != "" {
						ch <- core + e.output
						extend = true
					}
				})
			}
			if !extend {
				ch <- core
			}
		})
	})
}