RosettaCodeData/Task/Word-frequency/KAP/word-frequency.kap

8 lines
262 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
∇ stats (file) {
2026-04-30 12:34:36 -04:00
content ← "[\\h,.\"'\n-]+" regex:split unicode:toLower io:readFile file
sorted ← (⍋⊇⊢) content
selection ← 1,2≢/sorted
words ← selection / sorted
{⍵[10↑⍒⍵[;1];]} words ,[0.5] ≢¨ sorted ⊂⍨ +\selection
2023-07-01 11:58:00 -04:00
}