The experts will find this trivial, but I had to think it through for awhile and even ask a question or two of the monks when books fell short.

What you will find here is a fully functional NATO Phonetic Alphabet translator. I took one minor liberty in the translation table, by adding a 'phonetic' representation for space and newline.

The NATO Phonetic Alphabet was developed in the 1950s to be intelligible (and pronounceable) to all NATO allies in the heat of battle. It replaced other phonetic alphabets, such as the US military "able baker" alphabet.

The NATO Phonetic Alphabet is widely used in business, military, and paramilitary communications throughout Europe and North America. Anyone with a scanner tuned to a police or fire frequency will hear it almost immediately.

This JAPH is fairly straightforward, but was still fun to implement. It exceeds the traditional four line rule of thumb. Sorry; NATO chose long words. ;) Please reply with comments when you figure out the mechanism of action, and if you see ways to improve upon what's here, I'd love to hear.

Enjoy!!!!!

print${@qw{qw{Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India +Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango U +niform Victor Whiskey X-ray Yankee Zulu Zero Wun Two Tree Fower Five +Six Seven Ait Niner Stop Space Re}}=(A..Z,0..9,"."," ","\n");\%qw}{$_ +}for qw{Juliet Uniform Sierra Tango Space Alpha November Oscar Tango +Hotel Echo Romeo Space Papa Echo Romeo Lima Space Hotel Alpha Charlie + Kilo Echo Romeo Stop Re}

Dave

"If I had my life to do over again, I'd be a plumber." -- Albert Einstein


In reply to NATO Phonetic Alphabet JAPH by davido

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.