sub to_hash { my $file = shift; my $db = DBM::Deep->new( "$file.db" ); open(FILE, "<$file"); foreach $l () { my ($ngram,$line) = split /\t/, $l; push(@{ $db->{$ngram} }, $line); } close FILE; return $db; }