Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spelling_alphabet

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spelling_alphabet

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SpellingAlphabet

SpellingAlphabet is a conversion module for spelling alphabet (phonetic alphabet).

Supports Latin alphabets and Japanese kana.

Installation

Add this line to your application's Gemfile:

gem 'spelling_alphabet'

And then execute:

$ bundle

Or install it yourself as:

$ gem install spelling_alphabet

Usage

Gem

In your ruby source, write the line below:

require "spelling_alphabet"
Letters to Words
SpellingAlphabet::ITU.spellout("ABC") #=> "Alfa Bravo Charlie"
SpellingAlphabet::Japanese.spellout("イロハ") #=> "いろはのイ ローマのロ はがきのハ"
Words to letters
SpellingAlphabet::ITU.interpret("Yankee Zulu Nadazero")).to eq("YZ0")
SpellingAlphabet::Japanese.interpret("朝日のア いろはのイ 上野のウ") # => "アイウ"

Command

SpellingAlphabet gem also includes "spellout" command which converts given words to a sequence of spelling alphabet.

> spellout -h
Usage: spellout [options] WORDS
Convert WORDS to a sequence of spelling alphabet(phonetic alphabet)

Options:
    -w, --word-set=WORD_SET          Speify the word set for conversion (default: ITU)
    -i, --interpret                  Interpret WORDS instead of spellingout

Supported word sets:
   ITU       ITU Phonetic Alphabet and Figure Code
   ICAO      ICAO Radiotelephony Alphabet
   Japanese  Japanese radiotelephony alphabet (encoding is UTF-8 only)

Here are some examples:

> spellout a b 1
Alfa Bravo Unaone

> spellout -i Alfa Bravo Unaone
AB1

> spellout -w Japanese 1
数字のひと

Development

Test

Run the tests in spec directory:

$ cd spelling_alphabet
$ rake spec

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/hashimoton/spelling_alphabet.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 02 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc