4.3BSD/usr/contrib/icon/book/12/tabwords2.icn

procedure tabwords()
   static wchar
   local words, line
   initial wchar := &lcase ++ &ucase ++ '\'-'
   words := table(0)
   while line := read() do
      line ? while tab(upto(wchar)) do
         words[tab(many(wchar))] +:= 1
   return words
end