f = open('rfc3280.txt')
words = []
for line in f:
temp = line.split()
for item in temp:
if len(item) == 9:
words.append(item)
for item in words:
print item, words.count(item)
local file = io.open("rfc3280.txt")
local t = string.lower(file:read("*all"))
file:close()
local wrd, maxcount = "", 0
for word in t:gmatch("%a+") do
if #word == 9 then
local count = 0
for _ in t:gmatch(word) do
count = count + 1
end
if count > maxcount then
wrd = word
maxcount = count
end
end
end