| #!/usr/bin/env perl |
| use strict; |
| use warnings; |
| use KorAP::Def; |
| use lib 'lib'; |
| |
| # 2020-05-20 |
| # Preliminary support for C2 def-files. |
| # 2020-05-29 |
| # Introduce optimizable object system. |
| # 2024-07-17 |
| # Add KorAP::Def. |
| |
| our $VERSION = 0.2; |
| |
| our @ARGV; |
| |
| unless (@ARGV) { |
| print <<'HELP'; |
| Convert a line-separated list of corpus sigles, doc sigles or |
| text sigles into a virtual corpus query. |
| |
| $ perl list2vc.pl my_vc.txt | gzip -vc > my_vc.jsonld.gz |
| $ cat my_vc.txt | perl list2vc.pl - | gzip -vc > my_vc.jsonld.gz |
| |
| HELP |
| exit 0; |
| }; |
| |
| my $def_parser; |
| if ($ARGV[0] eq '-') { |
| $def_parser = KorAP::Def->new(\*STDIN); |
| } |
| else { |
| $def_parser = KorAP::Def->new($ARGV[0]); |
| }; |
| |
| $def_parser->parse; |
| |
| # Stringify current (extended?) virtual corpus |
| print $def_parser->to_string; |