| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
# $Id: NATO.pm,v 1.7 2008/09/07 03:23:37 Martin Exp $ |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
Lingua::Alphabet::Phonetic::NATO - map ABC's to the NATO phonetic letter names |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This is a specialization of Lingua::Alphabet::Phonetic. |
|
11
|
|
|
|
|
|
|
You should not use this module; |
|
12
|
|
|
|
|
|
|
all interaction should be done with an object of type Lingua::Alphabet::Phonetic. |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NOTES |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
http://en.wikipedia.org/wiki/NATO_phonetic_alphabet |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 BUGS |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Please tell the author if you find any! |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 LICENSE |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
This software is released under the same license as Perl itself. |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 AUTHOR |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Martin Thurn (mthurn@cpan.org). |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
##################################################################### |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
package Lingua::Alphabet::Phonetic::NATO; |
|
37
|
|
|
|
|
|
|
|
|
38
|
2
|
|
|
2
|
|
4428
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
74
|
|
|
39
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
66
|
|
|
40
|
|
|
|
|
|
|
|
|
41
|
2
|
|
|
2
|
|
11
|
use base 'Lingua::Alphabet::Phonetic'; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
834
|
|
|
42
|
|
|
|
|
|
|
our |
|
43
|
|
|
|
|
|
|
$VERSION = sprintf("%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/o); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my @asAlphabet = qw( |
|
46
|
|
|
|
|
|
|
Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliet Kilo Lima |
|
47
|
|
|
|
|
|
|
Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey |
|
48
|
|
|
|
|
|
|
Xray Yankee Zulu |
|
49
|
|
|
|
|
|
|
Zero One Two Three Four Five Six Seven Eight Niner |
|
50
|
|
|
|
|
|
|
); |
|
51
|
|
|
|
|
|
|
my %hash = map { $_ => shift @asAlphabet } ('a'..'z', 0..9); |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub _name_of_letter |
|
54
|
|
|
|
|
|
|
{ |
|
55
|
6
|
|
|
6
|
|
8
|
my $self = shift; |
|
56
|
6
|
|
|
|
|
399
|
my $s = shift; |
|
57
|
|
|
|
|
|
|
# print STDERR " + L::A::P::NATO::_name_of_letter($s)\n"; |
|
58
|
|
|
|
|
|
|
# If we get more than one character, ignore the rest: |
|
59
|
6
|
|
|
|
|
19
|
my $c = lc substr($s, 0, 1); |
|
60
|
6
|
100
|
|
|
|
18
|
if (exists($hash{$c})) |
|
61
|
|
|
|
|
|
|
{ |
|
62
|
4
|
|
|
|
|
24
|
return $hash{$c}; |
|
63
|
|
|
|
|
|
|
} # if |
|
64
|
2
|
|
|
|
|
15
|
return $self->SUPER::_name_of_letter($s); |
|
65
|
|
|
|
|
|
|
} # _name_of_letter |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |