]> git.donarmstrong.com Git - deb_pkgs/scowl.git/blob - src/proc-neol
fix numbering of variants to be 1 and 2 (closes: #867586)
[deb_pkgs/scowl.git] / src / proc-neol
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 chdir "r/alt12dicts";
7
8 open IN, "neol2016.txt";
9
10 my @words50;
11 my @words80;
12
13 $_ = <IN>;
14 chomp;
15 while (1) {
16     die unless defined $_;
17     last if $_ eq '';
18     my $word = $_;
19     $word =~ s/ *-> +\[.+\]//;
20     die "??>$word<" unless $word =~ /^[a-z]+$/;
21     push @words50, $word;
22     $_ = <IN>;
23     chomp;
24     my @words;
25     if (/\ +(.+)/) {
26         $_ = $1;
27         @words = split /, */;
28         foreach (@words) {s/ *-> +\[.+\]//}
29         $_ = <IN>;
30         chomp;
31     }
32     foreach (@words) {
33         if (s/\%$//) {push @words80, $_}
34         elsif (/^[a-z]+$/) {push @words50, $_}
35         else {die "???>$_<\n"}
36     }
37 }
38
39 while (<IN>) {
40     chomp;
41     next unless /^[A-Za-z\']+$/;
42     push @words50, $_;
43 }
44
45 open OUT, ">neol-50.lst";
46 foreach (sort @words50) {print OUT "$_\n"}
47
48 open OUT, ">neol-80.lst";
49 foreach (sort @words80) {print OUT "$_\n"}