@@ -1,7 +1,6 @@
2/+ gossip, default-agent, verb, dbug
2/+ gossip, default-agent, verb, dbug
6/+ m=metaphone
5/+ m=metaphone
7/$ grab-listing %noun %directory-listing
6/$ grab-listing %noun %directory-listing
@@ -12,29 +11,12 @@
13 +$ card card:agent:gall
12 +$ card card:agent:gall
14 +$ edition
13 +$ edition
15− $% state-0
14+ $% state-0:s
25− published=directory:s
27− +$ state-0
15+ state-1:s
33− =directory:directory-state-zero:s
34− published=directory:directory-state-zero:s
37−=| state-1
19+=| state:s
@@ -62,13 +44,9 @@
62 =/ old !<(edition vase)
44 =/ old !<(edition vase)
65− %1 `this(state old(published (purge published.old)))
47+ %2 `this(state (get-state-2 directory.old))
66− %0
48+ %1 `this(state (get-state-2 directory.old))
69− published.old (purge (directory-0-to-1 published.old))
70− directory.old (directory-0-to-1 directory.old)
49+ %0 `this(state (get-state-2 (directory-0-to-1 directory.old)))
73 ++ directory-0-to-1
51 ++ directory-0-to-1
74 |= =directory:directory-state-zero:s
52 |= =directory:directory-state-zero:s
@@ -79,6 +57,19 @@
79 =/ post post.listing(+63 [+63.post.listing ''])
57 =/ post post.listing(+63 [+63.post.listing ''])
80 listing(+2 post)
58 listing(+2 post)
71+ |= [[=hash:s l=listing:s] i=index:s]
72+ (~(catalog delver i) hash l)
83 |= =directory:s
74 |= =directory:s
84 ^- directory:s
75 ^- directory:s
@@ -193,10 +184,12 @@
193 %directory
184 %directory
194 =+ !<(d=directory:s vase)
185 =+ !<(d=directory:s vase)
195 =. directory (~(uni by directory) d)
186 =. directory (~(uni by directory) d)
197− ~(tap by d)
189+ ~(tap by d)
198− |= [[=hash:s l=listing:s] c=_cor]
190+ |= [[=hash:s l=listing:s] i=_index]
199− (index:c hash l)
191+ (~(catalog delver i) hash l)
@@ -234,7 +227,7 @@
234 ~(val by directory)
227 ~(val by directory)
235 |= =listing:s
228 |= =listing:s
236 |(=(filter %all) =(filter type.post.listing))
229 |(=(filter %all) =(filter type.post.listing))
237− =/ entries (~(get-entries delver [lookup trigrams phonetics]) term)
230+ =/ entries (~(get-entries delver index) term)
238 :: ~& %+ turn
231 :: ~& %+ turn
239 :: entries
232 :: entries
240 :: |= [=hash:s =rank:s]
233 :: |= [=hash:s =rank:s]
@@ -272,11 +265,11 @@
272 di-core(hash h, listing (~(gut by directory) h *listing:s))
265 di-core(hash h, listing (~(gut by directory) h *listing:s))
273 ++ di-remove
266 ++ di-remove
274 =. gone &
267 =. gone &
275− =/ keys (~(got by trail) hash)
268+ =/ keys (~(got by trail.index) hash)
276− =. trail (~(del by trail) hash)
269+ =. trail.index (~(del by trail.index) hash)
277− =. lookup
270+ =. lookup.index
278 ^- lookup:s
271 ^- lookup:s
279− %- ~(uni by lookup)
272+ %- ~(uni by lookup.index)
@@ -284,7 +277,7 @@
285 ^- (list entry:s)
278 ^- (list entry:s)
287− (~(got by lookup) key)
280+ (~(got by lookup.index) key)
288 |=([h=hash:s =rank:s] =(h hash))
281 |=([h=hash:s =rank:s] =(h hash))
289 =? published (~(has by published) hash)
282 =? published (~(has by published) hash)
290 (~(del by published) hash)
283 (~(del by published) hash)
@@ -292,73 +285,11 @@
292 ++ di-publish
285 ++ di-publish
293 |= l=listing:s
286 |= l=listing:s
294 =. listing l
287 =. listing l
295− =. cor (index hash l)
288+ =. index (~(catalog delver index) hash l)
296 =. published
289 =. published
297 ?. =(src our):bowl published
290 ?. =(src our):bowl published
298 (~(put by directory) hash.listing listing)
291 (~(put by directory) hash.listing listing)
299 =. cor (emit (invent:gossip %directory-listing !>(listing)))
292 =. cor (emit (invent:gossip %directory-listing !>(listing)))
303− |= [=hash:s l=listing:s]
304− ?> (lte (lent (trip title.post.l)) 77)
305− ?> (lte (lent (trip description.post.l)) 256)
306− ?> (lte (lent tags.post.l) 8)
307− ?> (lte (lent (trip link.post.l)) 1.024)
308− ?> (lte (lent (trip image.post.l)) 1.024)
310− ?: =(image.post.l '') cor
311− =/ image (validate image.post.l)
313− =/ link (validate link.post.l)
317− :~ ~[[(crip (cass (trip title.post.l))) ~[[hash rank=0]]]]
319− (sift:sift title.post.l)
321− [word ~[[hash rank=1]]]
325− [(norm:sift tag) ~[[hash rank=2]]]
327− (sift:sift description.post.l)
329− [word ~[[hash rank=3]]]
330− ~[[type.post.l ~[[hash rank=4]]]]
332− =/ keys ~(tap in ~(key by entries))
333− =. trail (~(put by trail) hash keys)
335− %- ~(uni by entries)
337− |= [=key:s value=(list entry:s)]
338− ?. (~(has by entries) key) value
339− (weld value (~(got by entries) key))
346− %+ turn (iching key)
348− [trigram (silt ~[key])]
350− |= [next=trigrams:s t=trigrams:s]
351− %- (~(uno by t) next)
352− |= [k=key:s v=(set key:s) w=(set key:s)]
356− %- ~(uno by phonetics)
360− [(utter:m key) (silt ~[key])]
361− |= [k=key:s v=(set key:s) w=(set key:s)]