on master help sign in
resetting from ngram experiment, trying to get more data in
52699e4Hunter Miller
desk/app/seek.hoon+23−81
@@ -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)
104+ %declarations
105+ =+ !<(declared=(list declare:s) vase)
106+ =. di-core (roll declared publish)
107+ cor
104 ==
108 ==
105 ++ publish
109 ++ publish
106− |= =listing:s
110+ |= [=declare:s core=_di-core]
107− ^+ cor
111+ ^+ di-core
108 ::
112 ::
109− ?> =(src.bowl source.listing)
110 ?> from-self
113 ?> from-self
114+ =/ listing
115+ :* post=q.declare
111− ?> =(hash.listing (digest post.listing))
116+ hash=(digest q.declare)
117+ reach=p.declare
118+ source=our.bowl
119+ time=now.bowl
120+ ==
112 ?: (~(has by directory) hash.listing)
121 ?: (~(has by directory) hash.listing)
113 ~& 'Listing already exists.'
122 ~& 'Listing already exists.'
114 cor
123 cor
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)
117 --
126 --
118::
127::
119++ watch
128++ watch
@@ -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)
169− ~& term-counts
170− =/ terms (get-terms term-counts)
171− ~& terms
172− =/ all=(list listing:s)
173− %- zing
174− %+ turn
175− terms
176− |= [=key:s v=@ud]
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
180 start
180 start
@@ -183,69 +183,15 @@
183 (lent all)
183 (lent all)
184 ==
184 ==
185 ==
185 ==
186−::
187−++ get-terms
188− |= tally=(map @t @ud)
189− ^- (list [@t @ud])
190− =/ sorted
191− %+ sort
192− ~(tap by tally)
193− |= [[k=@t v=@ud] [l=@t w=@ud]]
194− (lth v w)
195− =/ median-index (div (lent sorted) 2)
196− =/ q1 (median (scag +(median-index) sorted))
197− =/ q3 (median (slag median-index sorted))
198− =/ iqr (sub q3 q1)
199− %+ skim
200− sorted
201− |= [k=@t v=@ud]
202− (gth:rs (sun:rs v) (mul:rs (sun:rs q3) .1.5))
203−++ median
204− |= terms=(list [k=@t v=@ud])
205− ^- @ud
206− =/ length (lent terms)
207− =/ middle (div length 2)
208− ?. =((mod length 2) 0) (tail (snag middle terms))
209− %+ div
210− %+ add
211− (tail (snag middle terms))
212− (tail (snag +(middle) terms))
213− 2
214−++ get-term-counts
215− |= term=@t
216− ^- (map @t @ud)
217− =/ parts (split:sift term)
218− =/ ngrams=(list @t)
219− %- zing
220− %+ turn
221− parts
222− |= part=@t
223− (iching part)
224− %+ roll
225− ngrams
226− |= [ngram=@t tally=(map @t @ud)]
227− ^- (map @t @ud)
228− =/ words=(set @t) (~(gut by trigrams) ngram *(set @t))
229− %-
230− %- ~(uno by tally)
231− %- malt
232− %+ turn
233− ~(tap in words)
234− |= word=@t
235− [word 1]
236− |= [k=@t v=@ud w=@ud]
237− (add v w)
238++ get-hashes
186++ get-hashes
239 |= =key:s
187 |= =key:s
240− ^- (list hash:s)
241 %+ turn
188 %+ turn
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)
248− ^- (list listing:s)
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
265 %- malt
211 %- malt
266 %- zing
212 %- zing
267− :~ %+ turn
268− (sift:sift title.post.l)
269− |= word=@t
270− [word ~[[hash rank=0]]]
213+ :~ ~[[title.post.l ~[[hash rank=0]]]]
271− ~[[type.post.l ~[[hash rank=1]]]]
272 %+ turn
214 %+ turn
273 tags.post.l
215 tags.post.l
274 |= tag=@t
216 |= tag=@t
275− [tag ~[[hash rank=2]]]
217+ [tag ~[[hash rank=1]]]
276 %+ turn
218 %+ turn
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]]]]
280 ==
223 ==
281 =/ keys ~(tap in ~(key by entries))
224 =/ keys ~(tap in ~(key by entries))
282− ~& keys
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)
desk/gen/publish-all.hoonnew file+29
@@ -0,0 +1,29 @@
1+/- s=seek
2+/+ *seek
3+:- %say
4+|= $: [now=@da eny=@uv =beak]
5+ [ ~]
6+ ==
7+:- %declarations
8+^- (list declare:s)
9+:* :- %friends
10+ ['networked subject' %group 'web+urbitgraph://group/~matwet/networked-subject' 'https://subject.network | networked subject' 'https://urbits3.ams3.digitaloceanspaces.com/sitful-hatred/2022.7.07..17.15.52-ns.png' ~['hosting' 'networking' 'urbit' 'ops']]
11+ :- %friends
12+ ['Hooniverse' %group 'web+urbitgraph://group/~hiddev-dannut/new-hooniverse' 'Community based Hoon learning for all levels. For discussion of Hoon specific to Uqbar, join ~hiddev-dannut/uhoon' 'https://i.imgur.com/ghThlz7.png' ~['hoon' 'dev' 'urbit' 'programming' 'education']]
13+ :- %friends
14+ ['Hollow Mars Theory' %group 'web+urbitgraph://group/~rabsef-bicrym/hollow-mars-theory' 'Definitely NOT a Conspiracy Chat' '' ~['conspiracies' 'ufos' 'steel beams']]
15+ :- %friends
16+ ['celestial systems' %group 'web+urbitgraph://group/~nocsyx-lassul/celestial-systems' 'A place for pilots who are building hosting providers' '' ~['hosting' 'ops' 'urbit']]
17+ :- %friends
18+ ['Structure' %group 'web+urbitgraph://group/~fabled-faster/structure' 'Urbit Structural Design and Engineering Group. Always Thinking About Mechanics.' 'https://fabled-faster.nyc3.digitaloceanspaces.com/fabled-faster/2022.1.27..17.59.43-image.png' ~['design' 'ux' 'hci' 'urbit']]
19+ :- %friends
20+ ['The Marketplace' %group 'web+urbitgraph://group/~tirrel/the-marketplace' 'Welcome to The Marketplace, featuring The Pit, Urbit\'s first open-outcry market!' 'https://snipboard.io/U0IYyi.jpg' ~['urbit' 'market' 'sell' 'buy']]
21+ :- %friends
22+ ['The Forge' %group 'web+urbitgraph://group/~middev/the-forge' 'pale fire computing' 'https://nyc3.digitaloceanspaces.com/archiv/littel-wolfur/2021.5.06..21.01.58-the%20forge.png' ~['dev' 'programming' 'hoon' 'urbit']]
23+ :- %friends
24+ ['UFORIA' %group 'web+urbitgraph://group/~tiplec-lacnyx/ufora' 'UFO Research, Investigations, and Analysis' 'https://tiplec-lacnyx.nyc3.digitaloceanspaces.com/tiplec-lacnyx/2021.12.27..06.09.47-change1.jpg' ~['UFO' 'conspiracies' 'research']]
25+ :- %friends
26+ ['Urbit Community' %group 'web+urbitgraph://group/~bitbet-bolbel/urbit-community' 'World hub, help desk, meet and greet, etc.' 'https://fabled-faster.nyc3.digitaloceanspaces.com/fabled-faster/2021.4.02..21.52.41-UC.png' ~['general' 'urbit' 'community' 'help']]
27+ :- %friends
28+ ['Urbytes' %group 'web+urbitgraph://group/~nartes-fasrum/urbytes' 'We feed and water Mars.' '' ~['cooking' 'food' 'beverages' 'peanut butter eggs']]
29+==
desk/gen/publish.hoon+4−4
@@ -2,8 +2,8 @@
2/+ *seek
2/+ *seek
3:- %say
3:- %say
4|= $: [now=@da eny=@uv =beak]
4|= $: [now=@da eny=@uv =beak]
5− [[=post:s source=@p ~] ~]
5+ [[=post:s ~] ~]
6 ==
6 ==
7−:- %directory-listing
7+:- %declare
8−^- listing:s
8+^- declare:s
9−[post (digest post) %friends source now]
9+[%friends post]
desk/lib/seek-json.hoon+18−1
@@ -34,6 +34,23 @@
34++ dejs
34++ dejs
35 =, dejs:format
35 =, dejs:format
36 |%
36 |%
37−
37+ ++ declarations (ar declare)
38+ ++ declare
39+ ^- $-(json declare:s)
40+ %- ot
41+ :~ reach/(su (perk [%friends %public %private ~]))
42+ post/post
43+ ==
44+ ++ post
45+ ^- $-(json post:s)
46+ %- ot
47+ :~ title/so
48+ type/type
49+ link/so
50+ description/so
51+ tags/(ar so)
52+ image/so
53+ ==
54+ ++ type (su (perk [%app %group %content %other ~]))
38 --
55 --
39--
56--
desk/lib/sift.hoon+20−5
@@ -6,16 +6,31 @@
6 (split corpus)
6 (split corpus)
7 |= word=@t
7 |= word=@t
8 (~(has in words) word)
8 (~(has in words) word)
9+++ norm
10+ |= corpus=@t
11+ (crip (cass (trimall (crip (expunge corpus)))))
9++ split
12++ split
10 |= corpus=@t
13 |= corpus=@t
11 ^- (list @t)
14 ^- (list @t)
12− =/ lines (crip (trimall corpus))
15+ ~& (norm corpus)
13− %+ rash lines
16+ %+ rash (norm corpus)
14− (more ace (cook crip (plus ;~(pose aln hep))))
17+ (more ace (cook crip (plus allowed)))
18+++ allowed ;~(pose aln hep ace)
19+++ banned ;~(less allowed prn)
20+++ expunge
21+ |= corpus=@t
22+ ^- (list @t)
23+ %- zing
24+ %+ rash corpus
25+ %- star
26+ ;~ pose
27+ ;~(sfix allowed (plus banned))
28+ (plus allowed)
29+ ==
15++ trimall
30++ trimall
16− |= value=@t
31+ |= corpus=@t
17 |^ ^- tape
32 |^ ^- tape
18− %+ rash value
33+ %+ rash corpus
19 %+ ifix [(star ws) (star ws)]
34 %+ ifix [(star ws) (star ws)]
20 %- star
35 %- star
21 ;~ less
36 ;~ less
desk/mar/declarations.hoonnew file+14
@@ -0,0 +1,14 @@
1+/- s=seek
2+/+ j=seek-json
3+|_ d=(list declare:s)
4+++ grad %noun
5+++ grow
6+ |%
7+ ++ noun d
8+ --
9+++ grab
10+ |%
11+ ++ noun (list declare:s)
12+ ++ json declarations:dejs:j
13+ --
14+--
desk/mar/declare.hoonnew file+14
@@ -0,0 +1,14 @@
1+/- s=seek
2+/+ j=seek-json
3+|_ =declare:s
4+++ grad %noun
5+++ grow
6+ |%
7+ ++ noun declare
8+ --
9+++ grab
10+ |%
11+ ++ noun declare:s
12+ ++ json declare:dejs:j
13+ --
14+--
desk/sur/seek.hoon+4−2
@@ -28,14 +28,16 @@
28 image=@t
28 image=@t
29 ==
29 ==
30::
30::
31++$ reach ?(%private %friends %public)
32+::
33++$ declare (pair reach post)
34+::
31:: a listing includes the content of the post as well as information
35:: a listing includes the content of the post as well as information
32:: that would affect the hash so are left out, namely time, source and
36:: that would affect the hash so are left out, namely time, source and
33:: hash. each post has a source and time so that they can be updated
37:: hash. each post has a source and time so that they can be updated
34:: via the source requesting to replace the listing and hash.
38:: via the source requesting to replace the listing and hash.
35::
39::
36::
40::
37−+$ reach ?(%private %friends %public)
38−::
39+$ listing
41+$ listing
40 $: =post
42 $: =post
41 =hash
43 =hash