Coder Social home page Coder Social logo

nato's Introduction

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

nato's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.