2012-10-13 12:42:22 +00:00
|
|
|
#! /usr/bin/perl -w
|
|
|
|
|
|
|
|
sub usage {
|
2012-10-12 23:27:52 +00:00
|
|
|
print <<EoF;
|
2012-10-13 12:42:22 +00:00
|
|
|
Read the atis_lexicon.hxx file and print
|
|
|
|
the vocabulary words ... plus phonetic digits and letters.
|
|
|
|
|
|
|
|
See also list-airports.pl
|
|
|
|
|
|
|
|
Typical usage:
|
2012-10-12 23:27:52 +00:00
|
|
|
FG_ROOT=/home/whatever/fgdata FG_SRC=/home/whatever/flightgear ./atis-lex.pl > phraseology.vlist
|
2012-10-13 12:42:22 +00:00
|
|
|
EoF
|
|
|
|
}
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Symbol;
|
|
|
|
|
|
|
|
my $fgroot = $ENV{'FG_ROOT'} || '.';
|
|
|
|
|
|
|
|
main: {
|
|
|
|
if (@ARGV) {
|
|
|
|
usage;
|
|
|
|
exit;
|
|
|
|
}
|
2012-10-12 23:27:52 +00:00
|
|
|
my $mapfn = "$ENV{'FG_SRC'}/src/ATCDCL/atis_lexicon.hxx";
|
2012-10-13 12:42:22 +00:00
|
|
|
my $mapch = Symbol::gensym;
|
|
|
|
if (!open($mapch, '<', $mapfn)) {
|
|
|
|
print STDERR "Could not open abbreviation file '$mapfn'\n";
|
|
|
|
print STDERR "Maybe you need to set FG_ROOT\n";
|
|
|
|
exit(1);
|
|
|
|
}
|
2012-10-12 23:27:52 +00:00
|
|
|
print "/\n";
|
2012-10-13 12:42:22 +00:00
|
|
|
while (my $line = <$mapch>) {
|
|
|
|
chomp $line;
|
|
|
|
if ($line =~ s/^[ \t]*Q[(]//) {
|
|
|
|
$line =~ s/[)][ \t]*$//;
|
|
|
|
print "$line\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print <<EoF;
|
|
|
|
zero
|
|
|
|
one
|
|
|
|
two
|
|
|
|
three
|
|
|
|
four
|
|
|
|
five
|
|
|
|
six
|
|
|
|
seven
|
|
|
|
eight
|
|
|
|
nine
|
|
|
|
niner
|
|
|
|
alpha
|
|
|
|
bravo
|
|
|
|
charlie
|
|
|
|
delta
|
|
|
|
echo
|
|
|
|
foxtrot
|
|
|
|
golf
|
|
|
|
hotel
|
|
|
|
india
|
|
|
|
juliet
|
|
|
|
kilo
|
|
|
|
lima
|
|
|
|
mike
|
|
|
|
november
|
|
|
|
oscar
|
|
|
|
papa
|
|
|
|
quebec
|
|
|
|
romeo
|
|
|
|
sierra
|
|
|
|
tango
|
|
|
|
uniform
|
|
|
|
victor
|
|
|
|
whiskey
|
|
|
|
xray
|
|
|
|
yankee
|
|
|
|
zulu
|
2012-10-12 23:27:52 +00:00
|
|
|
decimal
|
2012-10-13 12:42:22 +00:00
|
|
|
EoF
|
|
|
|
}
|