Letter frequency: Difference between revisions
Content added Content deleted
Line 5,560:
select:[:assoc | assoc value isLetter ]
thenDo:[:assoc | assoc printCR].</lang>
If the file is huge, you may not want to read it in as a big string first, but
<lang smalltalk>bagOfChars := Bag new.
'someFile' asFilename readingLinesDo:[:eachLine | bagOfChars addAll:eachLine].
|