Word frequency: Difference between revisions
Content added Content deleted
(Added APL solution (credit: Hans-Peter Sorge)) |
m (→{{header|APL}}) |
||
Line 324: | Line 324: | ||
⍝⍝ Return the _n_ most frequent words and a count of their occurrences |
⍝⍝ Return the _n_ most frequent words and a count of their occurrences |
||
⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝ |
⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝ |
||
∇r ← n wordCount fname ;D |
∇r ← n wordCount fname ;D;wl;sidx;swv;pv;wc;uw;sortOrder |
||
D ← lowerAndStrip (⎕fio['read_file'] fname) ⍝ raw text with newlines |
D ← lowerAndStrip (⎕fio['read_file'] fname) ⍝ raw text with newlines |
||
wl ← (~ D ∊ ' ') ⊂ D |
wl ← (~ D ∊ ' ') ⊂ D |