all repos — honk @ 83ca3f088368feb9c5f5cbdbc8b9e86d0362fe5f

my fork of honk

filter on image desc too
Ted Unangst tedu@tedunangst.com
Sat, 21 Sep 2019 10:24:38 -0400
commit

83ca3f088368feb9c5f5cbdbc8b9e86d0362fe5f

parent

8dfa16ccc19e03a5ed5980d993909f69cf359d19

1 files changed, 16 insertions(+), 2 deletions(-)

jump to
M fun.gofun.go

@@ -71,7 +71,7 @@ zap := make(map[*Donk]bool)

h.Precis = unpucker(h.Precis) h.Noise = unpucker(h.Noise) h.Open = "open" - if badword := unsee(zilences, h.Precis, h.Noise); badword != "" { + if badword := unsee(zilences, h.Precis, h.Noise, h.Donks); badword != "" { if h.Precis == "" { h.Precis = badword }

@@ -142,7 +142,7 @@ honk.Noise = noise

honk.Onts = oneofakind(ontologies(honk.Noise)) } -func unsee(zilences []*regexp.Regexp, precis string, noise string) string { +func unsee(zilences []*regexp.Regexp, precis string, noise string, donks []*Donk) string { for _, z := range zilences { if z.MatchString(precis) || z.MatchString(noise) { if precis == "" {

@@ -151,6 +151,15 @@ return w[6 : len(w)-3]

} return precis } + for _, d := range donks { + if z.MatchString(d.Desc) { + if precis == "" { + w := z.String() + return w[6 : len(w)-3] + } + return precis + } + } } return "" }

@@ -163,6 +172,11 @@ for _, h := range honks {

for _, z := range zords { if z.MatchString(h.Precis) || z.MatchString(h.Noise) { continue outer + } + for _, d := range h.Donks { + if z.MatchString(d.Desc) { + continue outer + } } } honks[j] = h