Word frequency: Difference between revisions

Added Smalltalk
m (→‎{{header|Perl}}: future-proof for 5.36, 'use utf8')
(Added Smalltalk)
Line 4,962:
 
6 garbage collection(s) in 0.2 seconds.
</pre>
 
=={{header|Smalltalk}}==
The ascii text file is from https://www.gutenberg.org/files/135/old/lesms10.txt.
<syntaxhighlight lang="smalltalk">
"Cuis (University) v. 6.0-5510"
(StandardFileStream new open: 'lesms10.txt' forWrite: false)
contents asLowercase substrings asBag sortedCounts first: 10.
</syntaxhighlight>
<syntaxhighlight lang="smalltalk">
"Squeak v. 6.0-22104"
(StandardFileStream readOnlyFileNamed: 'lesms10.txt')
contents asLowercase substrings asBag sortedCounts first: 10.
</syntaxhighlight>
 
{{Out}}
<pre>
"Cuis"
an OrderedCollection(40543 -> 'the' 19796 -> 'of' 14448 -> 'and' 14380 -> 'a' 13582 -> 'to' 11006 -> 'in' 9221 -> 'he' 8351 -> 'was' 7258 -> 'that' 6420 -> 'his')
</pre>
<pre>
"Squeak"
{40543->'the' . 19796->'of' . 14448->'and' . 14380->'a' . 13582->'to' . 11006->'in' . 9221->'he' . 8351->'was' . 7258->'that' . 6420->'his'}
</pre>
 
27

edits