@@ -98,22 +98,31 @@
98 |= [=mark =vase]
98 |= [=mark =vase]
99 |^ ^+ cor
99 |^ ^+ cor
100 ?+ mark ~|(bad-poke/mark !!)
100 ?+ mark ~|(bad-poke/mark !!)
101− %directory-listing
101+ %declare
102− =+ !<(=listing:s vase)
102+ =+ !<(=declare:s vase)
103− (publish listing)
103+ di-abet:(publish declare di-core)
105+ =+ !<(declared=(list declare:s) vase)
106+ =. di-core (roll declared publish)
105 ++ publish
109 ++ publish
106− |= =listing:s
110+ |= [=declare:s core=_di-core]
107− ^+ cor
111+ ^+ di-core
109− ?> =(src.bowl source.listing)
110 ?> from-self
113 ?> from-self
111− ?> =(hash.listing (digest post.listing))
116+ hash=(digest q.declare)
112 ?: (~(has by directory) hash.listing)
121 ?: (~(has by directory) hash.listing)
113 ~& 'Listing already exists.'
122 ~& 'Listing already exists.'
115 =. published (~(put by directory) hash.listing listing)
124 =. published (~(put by directory) hash.listing listing)
116− di-abet:(di-publish:(di-abed:di-core hash.listing) listing)
125+ (di-publish:(di-abed:core hash.listing) listing)
@@ -165,16 +174,7 @@
165 =/ limit (slav %ud i.t.t.t.t.path)
174 =/ limit (slav %ud i.t.t.t.t.path)
166 :: expects encoded @t values)
175 :: expects encoded @t values)
167 =/ term `@t`(slav %t i.t.t.path)
176 =/ term `@t`(slav %t i.t.t.path)
168− =/ term-counts (get-term-counts term)
170− =/ terms (get-terms term-counts)
172− =/ all=(list listing:s)
177− (get-listings (get-hashes key))
177+ =/ all (get-listings (get-hashes term))
178 =/ listings (swag [start limit] all)
178 =/ listings (swag [start limit] all)
179 :* listings
179 :* listings
@@ -183,69 +183,15 @@
183 (lent all)
183 (lent all)
188− |= tally=(map @t @ud)
193− |= [[k=@t v=@ud] [l=@t w=@ud]]
195− =/ median-index (div (lent sorted) 2)
196− =/ q1 (median (scag +(median-index) sorted))
197− =/ q3 (median (slag median-index sorted))
202− (gth:rs (sun:rs v) (mul:rs (sun:rs q3) .1.5))
204− |= terms=(list [k=@t v=@ud])
206− =/ length (lent terms)
207− =/ middle (div length 2)
208− ?. =((mod length 2) 0) (tail (snag middle terms))
211− (tail (snag middle terms))
212− (tail (snag +(middle) terms))
217− =/ parts (split:sift term)
226− |= [ngram=@t tally=(map @t @ud)]
228− =/ words=(set @t) (~(gut by trigrams) ngram *(set @t))
236− |= [k=@t v=@ud w=@ud]
238++ get-hashes
186++ get-hashes
239 |= =key:s
187 |= =key:s
242 %+ sort (~(gut by lookup) key *(list entry:s))
189 %+ sort (~(gut by lookup) key *(list entry:s))
243 |= [a=entry:s b=entry:s]
190 |= [a=entry:s b=entry:s]
244 (gte rank.a rank.b)
191 (gte rank.a rank.b)
245 |=(=entry:s hash.entry)
192 |=(=entry:s hash.entry)
246++ get-listings
193++ get-listings
247− |= l=(list hash:s)
194+ |= l=(list hash)
249 %+ turn l
195 %+ turn l
250 |=(=hash:s (~(got by directory) hash))
196 |=(=hash:s (~(got by directory) hash))
251++ from-self =(our src):bowl
197++ from-self =(our src):bowl
@@ -264,22 +210,18 @@
264 =/ entries=lookup:s
210 =/ entries=lookup:s
268− (sift:sift title.post.l)
270− [word ~[[hash rank=0]]]
213+ :~ ~[[title.post.l ~[[hash rank=0]]]]
271− ~[[type.post.l ~[[hash rank=1]]]]
273 tags.post.l
215 tags.post.l
274 |= tag=@t
216 |= tag=@t
275− [tag ~[[hash rank=2]]]
217+ [tag ~[[hash rank=1]]]
277 (sift:sift description.post.l)
219 (sift:sift description.post.l)
278 |= word=@t
220 |= word=@t
279− [word ~[[hash rank=3]]]
221+ [word ~[[hash rank=2]]]
222+ ~[[type.post.l ~[[hash rank=3]]]]
281 =/ keys ~(tap in ~(key by entries))
224 =/ keys ~(tap in ~(key by entries))
283 =. trail (~(put by trail) hash keys)
225 =. trail (~(put by trail) hash keys)
284 =. lookup
226 =. lookup
285 %- ~(uni by entries)
227 %- ~(uni by entries)