summaryrefslogtreecommitdiff
path: root/scripts/acronyms.pl
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-12-20 10:28:46 +0100
committerDaniel Friesel <derf@finalrewind.org>2013-12-20 10:28:46 +0100
commit81806b59e1ebe7ea1f69a6ba0a192e483df0b594 (patch)
treeabc278f0d3e85c010ac4fb4adf2979ed4bc4add9 /scripts/acronyms.pl
Initial commit
Diffstat (limited to 'scripts/acronyms.pl')
-rwxr-xr-xscripts/acronyms.pl47
1 files changed, 47 insertions, 0 deletions
diff --git a/scripts/acronyms.pl b/scripts/acronyms.pl
new file mode 100755
index 0000000..d78afad
--- /dev/null
+++ b/scripts/acronyms.pl
@@ -0,0 +1,47 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use 5.010;
+
+my $re_line = qr{
+ ^
+ (?<acronym> [A-Z]{2}[A-Z ]{0,3} )
+ \s
+ (?<name> .+)
+ $
+}x;
+
+say <<'EOF';
+package Travel::Status::DE::IRIS::Acronyms;
+
+use strict;
+use warnings;
+use 5.010;
+use utf8;
+
+our $VERSION = '0.00';
+
+my @acronyms = (
+EOF
+
+while (my $line = <STDIN>) {
+ chomp $line;
+
+ if ($line =~ $re_line) {
+ my ($acronym, $name) = @+{qw{acronym name}};
+ $name =~ s{'}{\\'}g;
+
+ printf("\t['%s','%s'],\n", $acronym, $name);
+ }
+}
+
+say <<'EOF';
+);
+
+sub get_acronyms {
+ return @acronyms;
+}
+
+1;
+EOF