Example | Index << >> |
\:~ (# ; {.)/. ~ ;: t ⍒ ⍨ (⍴{⍺⍵}↑)Key⍨ words t sortd ← {⍵⌷⍨⊂⍒⍕⊃¨↓[0]⍵} ⍝ ⍒⍨ Key ← {⊃⍺⍺¨(↓(∪i)∘.=i←⍺⍳⍺)⌿¨⊂⍵} words ← {1↓¨(1+' '=⍵)⊂⍵} wfreq ← {sortd (⍴{⍺⍵}↑)Key⍨ words ⍵} disp wfreq t ┌→───┬────┐ ↓1992│the │ ├~──→┼───→┤ │1259│ of │ ├~──→┼───→┤ │1021│and │ ├~──→┼───→┤ │836 │your│ ├~──→┼───→┤ │825 │ to │ ├~──→┼───→┤ │802 │ my │ ├~──→┼───→┤ ... wfreq ← {sortd (⍴{⍺⍵}↑)Key⍨ words ⍵} wf ← sortd ∘ ((⍴{⍺⍵}↑)Key⍨) ∘ words (wfreq ≡ wf) t 1 |