Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,24 @@
require'files regex strings'
rxutf8 0 NB. support latin1 searches for this example, instead of utf8
files=:words=:buckets=:''
wordre=: rxcomp '[\w'']+'
parse=: ,@:rxfrom~ wordre&rxmatches
invert=: verb define
files=: files,todo=. ~.y-.files
>invert1 each todo
)
invert1=: verb define
file=. files i.<y
words=: ~.words,contents=. ~.parse tolower fread jpath y
ind=. words i. contents
buckets=: buckets,(1+words -&# buckets)#a:
#buckets=: (file,~each ind{buckets) ind}buckets
)
search=: verb define
hits=. buckets{~words i.~.parse tolower y
files {~ >([-.-.)each/hits
)

View file

@ -0,0 +1,9 @@
invert '~help/primer/cut.htm';'~help/primer/end.htm';'~help/primer/gui.htm'
>search 'finally learning'
~help/primer/end.htm
~help/primer/gui.htm
>search 'argument'
~help/primer/cut.htm
~help/primer/gui.htm
>search 'around'
~help/primer/gui.htm