]> git.mxchange.org Git - flightgear.git/blob - scripts/atis/atis-lex.pl
Support logging from Nasal at custom levels.
[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    FG_ROOT=/home/whatever/fgdata FG_SRC=/home/whatever/flightgear ./atis-lex.pl > phraseology.vlist
12 EoF
13 }
14
15 use strict;
16 use Symbol;
17
18   my $fgroot = $ENV{'FG_ROOT'} || '.';
19
20 main: {
21   if (@ARGV) {
22     usage;
23     exit;
24   }
25   my $mapfn = "$ENV{'FG_SRC'}/src/ATCDCL/atis_lexicon.hxx";
26   my $mapch = Symbol::gensym;
27   if (!open($mapch, '<', $mapfn)) {
28     print STDERR "Could not open abbreviation file '$mapfn'\n";
29     print STDERR "Maybe you need to set FG_ROOT\n";
30     exit(1);
31   }
32   print "/\n";
33   while (my $line = <$mapch>) {
34     chomp $line;
35     if ($line =~ s/^[ \t]*Q[(]//) {
36       $line =~ s/[)][ \t]*$//;
37       print "$line\n";
38     }
39   }
40   print <<EoF;
41 zero
42 one
43 two
44 three
45 four
46 five
47 six
48 seven
49 eight
50 nine
51 niner
52 alpha
53 bravo
54 charlie
55 delta
56 echo
57 foxtrot
58 golf
59 hotel
60 india
61 juliet
62 kilo
63 lima
64 mike
65 november
66 oscar
67 papa
68 quebec
69 romeo
70 sierra
71 tango
72 uniform
73 victor
74 whiskey
75 xray
76 yankee
77 zulu
78 decimal
79 EoF
80 }