Akron | 3f875be | 2020-05-11 14:57:19 +0200 | [diff] [blame] | 1 | #!/usr/bin/env perl |
Akron | 3587f36 | 2020-05-20 17:50:38 +0200 | [diff] [blame] | 2 | use strict; |
3 | use warnings; | ||||
Akron | 71cf2f5 | 2024-07-17 08:54:15 +0200 | [diff] [blame^] | 4 | use KorAP::Def; |
Akron | 34a4f58 | 2020-05-27 12:18:57 +0200 | [diff] [blame] | 5 | use lib 'lib'; |
Akron | 3f875be | 2020-05-11 14:57:19 +0200 | [diff] [blame] | 6 | |
Akron | 340a9cb | 2020-05-20 12:55:22 +0200 | [diff] [blame] | 7 | # 2020-05-20 |
8 | # Preliminary support for C2 def-files. | ||||
Akron | 34a4f58 | 2020-05-27 12:18:57 +0200 | [diff] [blame] | 9 | # 2020-05-29 |
10 | # Introduce optimizable object system. | ||||
Akron | 71cf2f5 | 2024-07-17 08:54:15 +0200 | [diff] [blame^] | 11 | # 2024-07-17 |
12 | # Add KorAP::Def. | ||||
Akron | 340a9cb | 2020-05-20 12:55:22 +0200 | [diff] [blame] | 13 | |
Akron | 71cf2f5 | 2024-07-17 08:54:15 +0200 | [diff] [blame^] | 14 | our $VERSION = 0.2; |
Akron | dd0aa3a | 2024-04-10 11:03:38 +0200 | [diff] [blame] | 15 | |
Akron | 26b5970 | 2020-05-19 12:14:41 +0200 | [diff] [blame] | 16 | our @ARGV; |
17 | |||||
Akron | 3f875be | 2020-05-11 14:57:19 +0200 | [diff] [blame] | 18 | unless (@ARGV) { |
19 | print <<'HELP'; | ||||
20 | Convert a line-separated list of corpus sigles, doc sigles or | ||||
21 | text sigles into a virtual corpus query. | ||||
22 | |||||
23 | $ perl list2vc.pl my_vc.txt | gzip -vc > my_vc.jsonld.gz | ||||
Akron | 26b5970 | 2020-05-19 12:14:41 +0200 | [diff] [blame] | 24 | $ cat my_vc.txt | perl list2vc.pl - | gzip -vc > my_vc.jsonld.gz |
Akron | 3f875be | 2020-05-11 14:57:19 +0200 | [diff] [blame] | 25 | |
26 | HELP | ||||
27 | exit 0; | ||||
28 | }; | ||||
29 | |||||
Akron | 71cf2f5 | 2024-07-17 08:54:15 +0200 | [diff] [blame^] | 30 | my $def_parser; |
Akron | 26b5970 | 2020-05-19 12:14:41 +0200 | [diff] [blame] | 31 | if ($ARGV[0] eq '-') { |
Akron | 71cf2f5 | 2024-07-17 08:54:15 +0200 | [diff] [blame^] | 32 | $def_parser = KorAP::Def->new(\*STDIN); |
33 | } | ||||
34 | else { | ||||
35 | $def_parser = KorAP::Def->new($ARGV[0]); | ||||
Akron | 3f875be | 2020-05-11 14:57:19 +0200 | [diff] [blame] | 36 | }; |
37 | |||||
Akron | 71cf2f5 | 2024-07-17 08:54:15 +0200 | [diff] [blame^] | 38 | $def_parser->parse; |
Akron | 26b5970 | 2020-05-19 12:14:41 +0200 | [diff] [blame] | 39 | |
Akron | 1c07045 | 2020-05-25 11:28:30 +0200 | [diff] [blame] | 40 | # Stringify current (extended?) virtual corpus |
Akron | 71cf2f5 | 2024-07-17 08:54:15 +0200 | [diff] [blame^] | 41 | print $def_parser->to_string; |