X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fadd-other-forms;h=921033910350ccd68f290e0010c728615a21a08d;hb=8ace84503eae30ad101165a9bf4c96ac1c87f9b1;hp=cd2f55de768376db770ffc4e54b14e92e49e5b90;hpb=fcd1b19126a5a5f7312c0d789c832742623fa5bd;p=deb_pkgs%2Fscowl.git diff --git a/src/add-other-forms b/src/add-other-forms index cd2f55d..9210339 100755 --- a/src/add-other-forms +++ b/src/add-other-forms @@ -4,29 +4,34 @@ open F, "r/alt12dicts/2of12id.txt" or die; while () { s/\r?\n$// or die; - ($d,$w,$p,$a) = /^(\-?)(\w+) (.).*: ?(.*?)$/ or die; - next if $d eq '-'; # + # (uncommon flag, base word, part of speach, inflected forms) + ($d,$w,$p,$a) = /^([-@\+]?)(\w+) (.).*: ?(.*?)$/ or die; + $d =~ tr/+//d; + next if $d; # @a0 = split / /, $a; - splice @a0, -1, 0, "'" if $p eq 'V' && @a0 >= 3; + splice @a0, -1, 0, "'" if $p eq 'V' && @a0 >= 3; # insert placeholder @a = (); foreach (@a0) { s/ {.+?}//g; s/ \(.+?\)//g; s/ \| / /g; s/ \/ / /g; push @a, (split / /, $_); } - @a = grep {!/^[@~-]/} @a; + @a = grep {!/^[@~!-]/} @a; # remove questionable entries + # @a now conatins a list of valid inflected forms @a0 = grep {$_ ne "'"} @a; + # @a0 is now the same as @a except for the placeholder entries next unless @a0; $words = join("\n",$w, @a0)."\n"; if ($p eq 'V' && @a >= 4) { while ($a[0] ne "'") {local $_ = shift @a; $lookup{$_} .= $words} shift @a; } + push @a, "$w\'s" if $p eq 'N'; $words = join("\n",$w, @a)."\n"; foreach (@a) {$lookup{$_} .= $words} } -open F, "working/possessive.lst"; +open F, "working/possessive-also.lst"; while () { chop;