% $Id: spellcheck.slang,v 1.0 2003/01/03 14:46:00 dada Exp $
% http://dada.perl.it/shootout/
%
% contributed by John E. Davis

define main()
{
   variable dict = Assoc_Type[Int_Type, 0];
   
   foreach (fopen("Usr.Dict.Words", "r")) using ("line")
     {
    variable word = strtrim();
    dict[word] = 1;
     }

   foreach (stdin)
     {
    word = strtrim ();
    !if (dict[word])
      () = fprintf (stdout, "%s\n", word);
     }
}

main();