3 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # This program is public domain
6 # Task: Open a text file and count the occurrences of each letter.
7 # SEE: <http://rosettacode.org/wiki/Letter_frequency>
12 var file
= new FileReader.open
("/etc/issue")
13 var counter
= new Counter[Char]
15 var char
= file
.read_char
16 if char
!= null and char
.is_letter
then
21 for char
, count
in counter
do
22 print
"{char} => {count}"