From 99c23cce34cb18518c555ed9bb8958ba96ce22c6 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Fri, 23 Oct 2015 20:50:41 +0200 Subject: Quote words in context too If the context contains a word that matches the keyword we quote it as well. --- gwic.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gwic.go b/gwic.go index fdefdad..a873467 100644 --- a/gwic.go +++ b/gwic.go @@ -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:]) -- cgit v1.2.1-18-gbd029