Project

NATO

0.01
No commit activity in last 3 years
No release in over 3 years
NATO Phonetic Alphabet conversion tool
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 10.4
~> 3

Runtime

~> 0.9
~> 4.2
 Project Readme

NATO

Code Climate

The NATO phonetic alphabet, more accurately known as the International Radiotelephony Spelling Alphabet, is the most widely used spelling alphabet. NATO assigns code words acrophonically to the letters of the English alphabet so that critical combinations of letters and numbers can be pronounced and understood by those who transmit and receive voice messages by radio or telephone regardless of their native language or the presence of transmission static.

The 26 code words and 10 numbers in the NATO phonetic alphabet are assigned to their respectives in the English alphabet in alphabetical order as follows:

  • Alfa
  • Bravo
  • Charlie
  • Delta
  • Echo
  • Foxtrot
  • Golf
  • Hotel
  • India
  • Juliett
  • Kilo
  • Lima
  • Mike
  • November
  • Oscar
  • Papa
  • Quebec
  • Romeo
  • Sierra
  • Tango
  • Uniform
  • Victor
  • Whiskey
  • X-ray
  • Yankee
  • Zulu
  • One
  • Two
  • Three
  • Four
  • Five
  • Six
  • Seven
  • Eight
  • Nine
  • Zero

Installation

Add this line to your application's Gemfile:

gem "NATO"

And then execute:

$ bundle

Or install it yourself as:

$ gem install NATO

Usage

require "NATO"

text = NATO::Text.new "a8h43lnr0"
text.to_nato # "Alfa Eight Hotel Four Three Lima November Romeo Zero"
text.pronunciation #'AL-FAH AIT HOH-TEL FOW-ER TREE LEE-MAH NO-VEM-BER ROW-ME-OH ZEE-RO'

Or, if you rather use refinements:

require "NATO/refined"

module YourApp
  using NATO::Refined

  "a8h43lnr0".to_nato # "Alfa Eight Hotel Four Three Lima November Romeo Zero"
end

Text-to-speach

You can also use the text-to-speech system tool:

require "NATO"

NATO::Text.new("bzt").say # pipes out to "say" on mac or "espeak" on linux

CLI

$ gem install NATO
$ nato --convert "bctz" # Bravo Charlie Tango Zulu
$ nato --say "bctz" # uses system text-to-speech tool

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request