czech-wordnet.pl: fix to work on non-GNU systems

This commit is contained in:
Přemysl Eric Janouch 2021-11-04 08:31:47 +01:00
parent b36f185426
commit 181df7fbae
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 4 additions and 1 deletions

View File

@ -4,11 +4,14 @@
use warnings; use warnings;
use strict; use strict;
# GNU Gzip can unpack a ZIP file, but not the BSD one, and unzip can't use stdin
my $zipcat = qx/command -v bsdtar/ ? 'bsdtar -xOf-' : 'zcat';
my $base = 'https://lindat.cz/repository/xmlui'; my $base = 'https://lindat.cz/repository/xmlui';
my $path = 'handle/11858/00-097C-0000-0001-4880-3'; my $path = 'handle/11858/00-097C-0000-0001-4880-3';
open(my $doc, '-|', open(my $doc, '-|',
"curl -Lo- '$base/bitstream/$path/Czech_WordNet_1.9_PDT.zip'" "curl -Lo- '$base/bitstream/$path/Czech_WordNet_1.9_PDT.zip'"
. ' | zcat | iconv -f latin2 -t UTF-8') or die $!; . " | $zipcat | iconv -f latin2 -t UTF-8") or die $!;
# https://nlp.fi.muni.cz/trac/deb2/wiki/WordNetFormat but not quite; # https://nlp.fi.muni.cz/trac/deb2/wiki/WordNetFormat but not quite;
# for terminology see https://wordnet.princeton.edu/documentation/wngloss7wn # for terminology see https://wordnet.princeton.edu/documentation/wngloss7wn