diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2015-10-23 20:50:41 +0200 |
---|---|---|
committer | Silvan Jegen <s.jegen@gmail.com> | 2015-10-27 21:40:57 +0100 |
commit | 99c23cce34cb18518c555ed9bb8958ba96ce22c6 (patch) | |
tree | 196a7206b594ee6ced63f7e8808bdf4dfdb7c3af | |
parent | 957ae48b0d7e2f6d0c51b78bbeff72fc9dd44b2e (diff) |
Quote words in context too
If the context contains a word that matches the keyword we quote it as
well.
-rw-r--r-- | gwic.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -79,11 +79,12 @@ func printqueue(q *queue, words chan string, kw string, left int, out chan strin continue } - q.insert(fmt.Sprintf("%q", w)) + qstr := fmt.Sprintf("%q", w) + q.insert(qstr) wc := &work{c: make(chan string, 10), left: 5, done: make(chan struct{})} - hungryhippos = feedworkers(hungryhippos, w) + hungryhippos = feedworkers(hungryhippos, qstr) sl := make([]string, MAX) copy(sl, q.q[6:]) |