if (@ARGV != 3){
  die ("Usage: perl CheckInDictionary.pl SubLexiconFile FullLexiconFile NotFoundInLexiconFile.");
}

#first read in the entire dictionary
%FullLexHash = ();
open(FullLexFILE,$ARGV[1]) or die "Couldn't open Full Lexicon File.\n";
@trs = <FullLexFILE>;
$c = 0;
foreach $tr (@trs){
  if ($tr =~ / -\> /){
    $c++;
    print $c . " ";
    $tr =~ tr/a-z/A-Z/;
    $tr =~ s/.*\|\://;
    $FullLexHash{$tr} = 1;
  }
}
print "done loading full lexicon.\n";

open(NotFoundFILE,">".$ARGV[2]) or die "Couldn't open not found lexicon file.\n";
open(SubLexiconFILE,$ARGV[0]) or die "Couldn't open sublexicon file.\n";
while(<SubLexiconFILE>){
  $_ =~ tr/a-z/A-Z/;
  $_ =~ s/.*\|\://;
  if ($_ =~ / -\> /){
    if (! exists $FullLexHash{$_}){
      print NotFoundFILE $_;
    }
  }
}
