#!/usr/local/bin/perl

open(In, $ARGV[0]) or
    die "coudln't open in file.\n";

open (Out, ">".$ARGV[1]) or 
    die "couldn't open out file\n";

open (Dict, "Dictionary.txt") or
    die "Couldn't open dictionary file\n";

$D = <Dict>;
@TmpWords = <In>;
@Words = split(/ /, @TmpWords[0]);


$InDict = 0;
$OutOfDict = 0;
$Total = 0;
foreach $Word (@Words){
    print Out "cur word is:|$Word|\n";
    $Word = " ".$Word." ";
    $Total++;
    if ($D =~ $Word){
	$InDict++;
	print Out "in dict:|$Word|\n";
    }
    else{
	$OutOfDict++;
    }
}

print Out "total: $Total\n";
print Out "inVoc: $InDict\n";
print Out "OutOfVoc: $OutOfDict\n";
