]> git.donarmstrong.com Git - deb_pkgs/scowl.git/blob - src/add-other-forms
[svn-inject] Installing original source of scowl
[deb_pkgs/scowl.git] / src / add-other-forms
1 #!/usr/bin/perl
2
3 open F, "r/alt12dicts/2of12id.txt" or die;
4
5 while (<F>) {
6   s/\r?\n$// or die;
7   ($d,$w,$p,$a) = /^(\-?)(\w+) (.).*: ?(.*?)$/ or die;
8   next if $d eq '-'; #
9   @a0 = split /  /, $a;
10   splice @a0, -1, 0, "'" if $p eq 'V' && @a0 >= 3;
11   @a = ();
12   foreach (@a0) {
13     s/ {.+?}//g; s/ \(.+?\)//g; 
14     s/ \| / /g; s/ \/ / /g;
15     push @a, (split / /, $_);
16   }
17   @a = grep {!/^[@~-]/} @a;
18   @a0 = grep {$_ ne "'"} @a;
19   next unless @a0;
20   $words = join("\n",$w, @a0)."\n";
21   if ($p eq 'V' && @a >= 4) {
22     while ($a[0] ne "'") {local $_ = shift @a; $lookup{$_} .= $words}
23     shift @a;
24   }
25   $words = join("\n",$w, @a)."\n";
26   foreach (@a) {$lookup{$_} .= $words}
27 }
28
29 open F, "working/possessive.lst";
30
31 while (<F>) {
32   chop;
33   $lookup{"$_\'s"} .= "$_\n";
34 }
35
36 while (<STDIN>) {
37   print;
38   chop;
39   print $lookup{$_};
40 }