#!/usr/bin/perl
#
#    Copyright 2004 by Jason Stover.
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of the GNU General Public License as
#    published by the Free Software Foundation; either version 2 of the
#    License, or (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
#    02111-1307  USA
#
open(PVALS,"</mnt/biafra/jason/src/compling/wordhash_pvalues.txt") or die "cannot open file\n";
open(WORDHASH,"</mnt/biafra/jason/var/wordhash.txt") or die "cannot open other file\n";
%words=();
%pvals=();
while($wordhash=<WORDHASH>)
{
    chomp $wordhash;
    ($word,$key)=split ' ',$wordhash;
    # This will make sense in a moment.
    $words{$word}=$key;
}
close(WORDHASH);
while($line=<PVALS>)
{
    chomp $line;
    ($key,$pval) = split ' ',$line;
    $pvals{$key}=$pval;
}
close(PVALS);
foreach $key (keys(%words))
{
    $pey = $words{$key};
    $words{$key}=$pvals{$pey};
}
foreach $key (keys(%words))
{
    print $key,"\t",$words{$key},"\n";
}

