#!/usr/bin/perl

# Perl script to index abbreviations and personal nouns databases.

use SDBM_File;

#Abbreviations
my %abbrevs = ();

dbmopen(%abbrevs, "abbrevs", 0666) or die "Can't open abbreviations diskhash abbrevs: $!\n";

open ABBFILE,"abbreviations.list" or die "Can't open abbreviations list";
while ($line = <ABBFILE>) {
#  $line =~ s/\015//;
  $line =~ s/\r//;
  chop $line;
#  print "<S>$line<E>";
  $abbrevs{$line}= 1;
}
close ABBFILE;

dbmclose(%abbrevs);


#Personal nouns
my %pnouns = ();
dbmopen(%pnouns, "pnouns", 0666) or die "Can't open personal nouns diskhash pnouns: $!\n";

open PNSFILE,"pernouns.list" or die "Can't open personal nouns list";
while ($line = <PNSFILE>) {
#  $line =~ s/\015//;
  $line =~ s/\r//;
  chop $line;
#  print "<S>$line<E>";
  $pnouns{$line}= 1;
}
close PNSFILE;

dbmclose(%pnouns);

