blob: c0b3ed2aed3c352c99df7ff1ace44e2706a3c6e2 [file] [log] [blame]
Akron3f875be2020-05-11 14:57:19 +02001#!/usr/bin/env perl
Akron3587f362020-05-20 17:50:38 +02002use strict;
3use warnings;
Akron71cf2f52024-07-17 08:54:15 +02004use KorAP::Def;
Akron34a4f582020-05-27 12:18:57 +02005use lib 'lib';
Akron3f875be2020-05-11 14:57:19 +02006
Akron340a9cb2020-05-20 12:55:22 +02007# 2020-05-20
8# Preliminary support for C2 def-files.
Akron34a4f582020-05-27 12:18:57 +02009# 2020-05-29
10# Introduce optimizable object system.
Akron71cf2f52024-07-17 08:54:15 +020011# 2024-07-17
12# Add KorAP::Def.
Akron340a9cb2020-05-20 12:55:22 +020013
Akron71cf2f52024-07-17 08:54:15 +020014our $VERSION = 0.2;
Akrondd0aa3a2024-04-10 11:03:38 +020015
Akron26b59702020-05-19 12:14:41 +020016our @ARGV;
17
Akron3f875be2020-05-11 14:57:19 +020018unless (@ARGV) {
19 print <<'HELP';
20Convert a line-separated list of corpus sigles, doc sigles or
21text sigles into a virtual corpus query.
22
23 $ perl list2vc.pl my_vc.txt | gzip -vc > my_vc.jsonld.gz
Akron26b59702020-05-19 12:14:41 +020024 $ cat my_vc.txt | perl list2vc.pl - | gzip -vc > my_vc.jsonld.gz
Akron3f875be2020-05-11 14:57:19 +020025
26HELP
27exit 0;
28};
29
Akron71cf2f52024-07-17 08:54:15 +020030my $def_parser;
Akron26b59702020-05-19 12:14:41 +020031if ($ARGV[0] eq '-') {
Akron71cf2f52024-07-17 08:54:15 +020032 $def_parser = KorAP::Def->new(\*STDIN);
33}
34else {
35 $def_parser = KorAP::Def->new($ARGV[0]);
Akron3f875be2020-05-11 14:57:19 +020036};
37
Akron71cf2f52024-07-17 08:54:15 +020038$def_parser->parse;
Akron26b59702020-05-19 12:14:41 +020039
Akron1c070452020-05-25 11:28:30 +020040# Stringify current (extended?) virtual corpus
Akron71cf2f52024-07-17 08:54:15 +020041print $def_parser->to_string;