X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=6%2Fsrc%2Fadd-other-spellings;fp=6%2Fsrc%2Fadd-other-spellings;h=0000000000000000000000000000000000000000;hb=b13ea8a082364672c6de2b010e558211ff52ec9a;hp=5bdc04259d1e17324461da1ea778637ada9a207b;hpb=01534a94130c1f5a3a230cf4fe18365a235ba271;p=deb_pkgs%2Fscowl.git diff --git a/6/src/add-other-spellings b/6/src/add-other-spellings deleted file mode 100755 index 5bdc042..0000000 --- a/6/src/add-other-spellings +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/perl - -while() { - chop; - $words{$_} = ''; - $know_about{$_} = 1; -} - -sub valid_entry ( $ ){local $_ = $_[0]; /^[A-Za-z\']+$/ && exists $words{$_}} - -foreach my $f (qw(working/variant_0.lst working/variant_1.lst - working/variant_2.lst r/varcon/abbc.tab)) -{ - open F, $f or die "Unable to open $f\n"; - while () { - my (@words) = split /[\t\n]+/; - $know_about{$_} = 1 foreach @words; - } -} - -open F, "r/varcon/voc.tab" or die; - -while () { - s/\(.+\)\n/\n/; - my ($word) = grep {valid_entry $_} (split /[,\t\n]/); - next unless defined $word; - y/,\t -/\n/; - $words{$word} .= $_; -} - -open F, "r/varcon/variant.tab" or die; - -while () { - @w = grep {$know_about{$_}} (split /[\t\n]/); - next unless @w && grep {valid_entry $_} @w; - $words{$w[0]} .= "$_\n" foreach @w; -} - -open F, "r/varcon/variant-wroot.tab" or die; - -while () { - s/^(.+)\:\t// or die; - my $root = $1; - next unless exists $words{$root}; - @w = grep {$know_about{$_}} (split /[\t\n]/); - next unless @w && grep {valid_entry $_} @w; - $words{$w[0]} .= "$_\n" foreach @w; -} - -while (($key, $value) = each %words) { - print "$key\n$value"; -}