#!/usr/bin/perl #script 1. Fills the hash use warnings; use strict; use DBM::Deep; my $file_in_en=shift; my %hash_en=to_hash($file_in_en); sub to_hash { my $file = shift; my $db = DBM::Deep->new( "$file.db" ); $db->clear(); open(FILE, "<$file"); foreach $l () { my ($ngram,$line) = split /\t/, $l; push(@{ $db->{$ngram} }, $line); } close FILE; return $db; }