]> git.mxchange.org Git - flightgear.git/blob - scripts/atis/atis-lex.pl
Original ATIS voice generation scripts by John Denker
[flightgear.git] / scripts / atis / atis-lex.pl
1 #! /usr/bin/perl -w
2
3 sub usage {
4   print <<\EoF;
5 Read the atis_lexicon.hxx file and print
6 the vocabulary words ... plus phonetic digits and letters.
7
8 See also list-airports.pl
9
10 Typical usage:
11   (echo "/"
12    FG_ROOT=/games/$whatever/fgd ATIS_ONLY=yes ./list-airports.pl
13    FG_ROOT=/games/$whatever/fgd ./atis-lex.pl) > $whatever.vlist
14 EoF
15 }
16
17 use strict;
18 use Symbol;
19
20   my $fgroot = $ENV{'FG_ROOT'} || '.';
21
22 main: {
23   if (@ARGV) {
24     usage;
25     exit;
26   }
27   my $mapfn = "$fgroot/../fgs/src/ATCDCL/atis_lexicon.hxx";
28   my $mapch = Symbol::gensym;
29   if (!open($mapch, '<', $mapfn)) {
30     print STDERR "Could not open abbreviation file '$mapfn'\n";
31     print STDERR "Maybe you need to set FG_ROOT\n";
32     exit(1);
33   }
34   while (my $line = <$mapch>) {
35     chomp $line;
36     if ($line =~ s/^[ \t]*Q[(]//) {
37       $line =~ s/[)][ \t]*$//;
38       print "$line\n";
39     }
40   }
41   print <<EoF;
42 zero
43 one
44 two
45 three
46 four
47 five
48 six
49 seven
50 eight
51 nine
52 niner
53 alpha
54 bravo
55 charlie
56 delta
57 echo
58 foxtrot
59 golf
60 hotel
61 india
62 juliet
63 kilo
64 lima
65 mike
66 november
67 oscar
68 papa
69 quebec
70 romeo
71 sierra
72 tango
73 uniform
74 victor
75 whiskey
76 xray
77 yankee
78 zulu
79 EoF
80 }