Function frequency: Difference between revisions
J: supply some missing code and count more thoroughly (previously comments would "eat almost everything")
Catskill549 (talk | contribs) |
(J: supply some missing code and count more thoroughly (previously comments would "eat almost everything")) |
||
Line 912:
<lang j>
IGNORE=: ;:'y(0)1',CR
Filter=: (#~`)(`:6)
NB.
roughparse=: ;@(<@;: ::(''"_);._2)
top10=: 10 {. \:~@:((#;{.)/.~@:(e.&PRIMITIVES Filter@:;:))▼
NB. count frequencies and get the top x
NB. read all installed script (.ijs) files and concatenate them
JSOURCE=: ;fread each 1&e.@('.ijs'&E.)@>Filter {."1 dirtree jpath '~install'
10 top (roughparse JSOURCE)-.IGNORE
┌─────┬──┐
├─────┼──┤
├─────┼──┤
├─────┼──┤
│34096│=.│
├─────┼──┤
│24757│+ │
├─────┼──┤
│18726│" │
├─────┼──┤
├─────┼──┤
│18446│/ │
├─────┼──┤
│16984│> │
├─────┼──┤
│14655│@ │
└─────┴──┘
</lang>
|