Created
October 1, 2010 19:26
-
-
Save sekimura/606709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my $input = shift or die "Usage: $0 Masayoshi"; | |
my %phoetic_alphabet; | |
while(<DATA>) { | |
chomp; | |
my ($letter, $word) = split(/\s+/, $_, 2); | |
$phoetic_alphabet{lc($letter)} = $word; | |
} | |
my @result = map { | |
my $letter = lc($_); | |
"$letter in " . $phoetic_alphabet{$letter}; | |
} $input =~ /(\w)/g; | |
system("say", join(", ", @result)); | |
## http://en.wikipedia.org/wiki/ICAO_spelling_alphabet | |
__DATA__ | |
A Alpha | |
B Bravo | |
C Charlie | |
D Delta | |
E Echo | |
F Foxtrot | |
G Golf | |
H Hotel | |
I India | |
J Juliet | |
K Kilo | |
L Lima | |
M Mike | |
N November | |
O Oscar | |
P Papa | |
Q Quebec | |
R Romeo | |
S Sierra | |
T Tango | |
U Uniform | |
V Victor | |
W Whisky | |
X X-ray | |
Y Yankee | |
Z Zulu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment