X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/50442220cc52bad55c1003de34f8dada958650d5..ed1c096fecf0abce1d1d061f5b9f7cb5fbef7645:/word.plp?ds=inline diff --git a/word.plp b/word.plp index f47c4f4..aedca9d 100644 --- a/word.plp +++ b/word.plp @@ -1,132 +1,27 @@ <(common.inc.plp)><: -our $lang = $get{lang} || 'en'; -our $wordlistbase = "data/wordlist"; - -if ($Request and $Request =~ m{\A([^/]+)}) { - my $page = "word/$1.plp"; +my ($name) = $Request ? $Request =~ m{\A(\w+)} : 'finder'; +if (-e (my $page = "word/$name.plp")) { utf8::downgrade($page); # unicode filename breaks contents encoding - if (-e $page) { - $wordlistbase .= ".$lang"; - Include $page; - exit; - } -} - -my $wordlist = "$wordlistbase.inc.pl"; -my $limit = $get{v} // (exists $get{v} ? 4 : 3); - -Html({ - title => 'words cheat sheet', - version => '1.0', - description => "Visual words", - keywords => [qw' - language - '], - data => [$wordlist], - raw => (exists $get{q} && <<'EOT') - -EOT - . <<'EOT', - -EOT -}); - -if (exists $get{debug}) { - say ''; -} -:> -
-Under construction. -Zie ook dieren. -Omit translations to test. -
- -<: -my $table = do $wordlist or die $@ // $!; - -sub showimg { - my ($id, $name) = @_; - my ($imgname) = $name =~ m{^([^/]+)}; - $name =~ s/\w{4} [^aoeuiyc\W] [rl]?+ \K (?= [^aoeuiy\W] [rl]? [aoeuiy] \w)//gx; - ($name, my @morenames) = split m{/}, $name; - $name =~ s{\( ([^/]+) \)}{$1}x; - $name .= " ($_)" for @morenames; - my $hidden = $name =~ s/\?$//; - $name = "$name" if $name =~ s/\?$//; - $name = "
$namenot found"]; } -say '