phonetic_encoder 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +3 -0
- data/.rubocop.yml +33 -0
- data/.travis.yml +33 -0
- data/CHANGELOG.md +5 -0
- data/CODEOWNERS +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +83 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/phonetic_encoder +81 -0
- data/lib/phonetic_encoder.rb +36 -0
- data/lib/phonetic_encoder/dicts/nato.rb +28 -0
- data/lib/phonetic_encoder/dicts/sounds.rb +28 -0
- data/lib/phonetic_encoder/version.rb +3 -0
- data/phonetic_encoder.gemspec +27 -0
- metadata +106 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bffd07f7683a402aee61e29fb8ac44fc5e4a4e3dc7eefdba982a83c16d313e1b
|
4
|
+
data.tar.gz: 768e2c485c8600e6bdc37c190effb218f7733a79c807895e27cbf9629842bfba
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3f3a201efed82057d67ba2a4852e20a6614947d5f37d7216aacdad9182ca02f99978c76c9d6908e8f6bb1c52854a879e508e216ede15e0f19c2e694ef7791cb8
|
7
|
+
data.tar.gz: 6f4be6b167f10e9b6d1ece2e3144a5d54dad913d91ee1fd0fbdc3634c7389cc0958599b8467f46f0c774b2bcd5c4273040c07ad5197a955eac7924ea61326189
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
Layout/IndentationWidth:
|
2
|
+
Width: 4
|
3
|
+
|
4
|
+
Metrics/AbcSize:
|
5
|
+
Max: 50
|
6
|
+
|
7
|
+
Metrics/LineLength:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Metrics/BlockLength:
|
11
|
+
Max: 40
|
12
|
+
|
13
|
+
Metrics/CyclomaticComplexity:
|
14
|
+
Max: 20
|
15
|
+
|
16
|
+
Metrics/MethodLength:
|
17
|
+
Max: 60
|
18
|
+
|
19
|
+
Metrics/PerceivedComplexity:
|
20
|
+
Max: 20
|
21
|
+
|
22
|
+
Naming/FileName:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Style/GlobalVars:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Style/RaiseArgs:
|
29
|
+
EnforcedStyle: compact
|
30
|
+
|
31
|
+
Style/WordArray:
|
32
|
+
EnforcedStyle: brackets
|
33
|
+
|
data/.travis.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
sudo: required
|
2
|
+
matrix:
|
3
|
+
include:
|
4
|
+
- language: ruby
|
5
|
+
rvm: 2.2
|
6
|
+
before_install:
|
7
|
+
- gem install bundler -v 1.16.1
|
8
|
+
- language: ruby
|
9
|
+
rvm: 2.4.4
|
10
|
+
before_install:
|
11
|
+
- gem install bundler -v 1.17.3
|
12
|
+
- language: ruby
|
13
|
+
env: SKIP_INTERPRETER=true
|
14
|
+
rvm: 2.4.4
|
15
|
+
before_install:
|
16
|
+
- git clone https://github.com/TravisToolbox/rubocop-travis.git travis/rubocop
|
17
|
+
install:
|
18
|
+
- ./travis/rubocop/install.sh
|
19
|
+
script:
|
20
|
+
- ./travis/rubocop/scan.sh
|
21
|
+
- language: ruby
|
22
|
+
rvm: 2.2
|
23
|
+
before_install:
|
24
|
+
- mkdir travis
|
25
|
+
- git clone https://github.com/TravisToolbox/awesomebot-travis.git travis/awesomebot
|
26
|
+
install:
|
27
|
+
- ./travis/awesomebot/install.sh
|
28
|
+
script:
|
29
|
+
- ./travis/awesomebot/scan.sh
|
30
|
+
notifications:
|
31
|
+
email: false
|
32
|
+
slack:
|
33
|
+
secure: AQJTKN/jwYYuFhEmFeLbTdDA8BUue1SSK9KppAFfRgDPLVeo0NhNtAWjSg+cAw6eZx4byKv3cLe2cUrNwxcPJf0XWMsEnNrja8dx+Y8e/R19rWvAMKpSnEyHhLWoTOL9+lQFbQfS4/GC0tTz/riqirr+OmhFmuUQ4rVmR/VxqAZrQjiu9ab2mgkKGG1wj9p8gUCdqqy1GB/20dRXvZ0MMoKbXORBbXFThmEc0ItWB7n+3bb+GMfT71/4roTJdlMRtPKSYF6JtDi0AfUpd8p5+J4JwfJqDwHB/j4FttiryI3aj2ixTMpenEE5cHon33Yn/L3mzj1P0YilghMbrgLI+O/FCpYUemXZi3BZ6OhosXNaIe19delXaPfu58nbqkaN9BLD1fN8cwBkKYIe6r1m8+FvIf8sF9xOxNsMx8EOepiYbsMX1LytSvRCI3I8ydgdSJxkSRbYFsnFV3hvpOg/46t9AU+TlkEq3vtX3SAUrrUEEbHfkij4puYhgZKFfry9Drnk8HEmJesVPMMuzYbYCaXRKazeHVErEtfSmWggz7DV4zEKWv9SKYuYLvRfosEzuvkA8/uUpTPTtd9uwIcB6Hued96KNOJpyKn1v55wjdKhkyOYPX6UvhsTEXkoBkgMuNiKjFYpKqCp69c4iuIG4YgqMubF5e9p33c2yAZy/FM=
|
data/CHANGELOG.md
ADDED
data/CODEOWNERS
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at tim.gurney@timgurney.net. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Tim Gurney
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
[![Build Status](https://img.shields.io/travis/WolfSoftware/phonetic_encoder/master.svg)](https://travis-ci.org/WolfSoftware/phonetic_encoder)
|
2
|
+
[![Software License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)
|
3
|
+
[![Release](https://img.shields.io/github/release/wolfsoftware/phonetic_encoder.svg)](https://github.com/wolfsoftware/phonetic_encoder/releases/latest)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/phonetic_encoder.svg)](https://badge.fury.io/rb/phonetic_encoder)
|
5
|
+
[![Github commits (since latest release)](https://img.shields.io/github/commits-since/wolfsoftware/phonetic_encoder/latest.svg)](https://github.com/wolfsoftware/phonetic_encoder/commits)
|
6
|
+
[![GitHub repo size in bytes](https://img.shields.io/github/repo-size/wolfsoftware/phonetic_encoder.svg)](https://github.com/wolfsoftware/phonetic_encoder)
|
7
|
+
[![GitHub contributors](https://img.shields.io/github/contributors/wolfsoftware/phonetic_encoder.svg)](https://github.com/wolfsoftware/phonetic_encoder)
|
8
|
+
|
9
|
+
# Phonetic Encoder
|
10
|
+
|
11
|
+
A ruby gem to display the NATO Phonetic name for any given letter. You can also pass custom dictionaries.
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
Add this line to your application's Gemfile:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
gem 'phonetic_encoder'
|
19
|
+
```
|
20
|
+
|
21
|
+
And then execute:
|
22
|
+
|
23
|
+
$ bundle
|
24
|
+
|
25
|
+
Or install it yourself as:
|
26
|
+
|
27
|
+
$ gem install phonetic_encoder
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
### Simple Usage
|
32
|
+
|
33
|
+
You can use the default built in dictionary which is NATO.
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
pe = PhoneticEncoder.new
|
37
|
+
|
38
|
+
puts pe.encode('abc')
|
39
|
+
```
|
40
|
+
|
41
|
+
### Extended Usage
|
42
|
+
|
43
|
+
You can also use the built-in 'sounds' dictionary.
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
pe = PhoneticEncoder.new
|
47
|
+
|
48
|
+
puts pe.encode('abc', 'sounds')
|
49
|
+
```
|
50
|
+
|
51
|
+
### Advanced Usage
|
52
|
+
|
53
|
+
You can define your own dictionary, the below example just does a single item, but you can make the set as large as you need.
|
54
|
+
|
55
|
+
```
|
56
|
+
pe = PhoneticEncoder.new
|
57
|
+
|
58
|
+
pe.custom('custom', 'a' => 'apple', 'b' => 'ballon', 'c' => 'cat')
|
59
|
+
|
60
|
+
puts pe.encode('abc', 'custom')
|
61
|
+
```
|
62
|
+
|
63
|
+
## Development
|
64
|
+
|
65
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
66
|
+
|
67
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
68
|
+
|
69
|
+
## Testing
|
70
|
+
|
71
|
+
For local testing make sure that you run `bundle exec rspec spec` and then `rake install` to install the gem locally.
|
72
|
+
|
73
|
+
## Contributing
|
74
|
+
|
75
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/WolfSoftware/phonetic_encoder. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
76
|
+
|
77
|
+
## License
|
78
|
+
|
79
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
80
|
+
|
81
|
+
## Code of Conduct
|
82
|
+
|
83
|
+
Everyone interacting in the phonetic_encoder project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/WolfSoftware/phonetic_encoder/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "phonetic_encoder"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'phonetic_encoder'
|
5
|
+
|
6
|
+
# -------------------------------------------------------------------------------- #
|
7
|
+
# Encode #
|
8
|
+
# -------------------------------------------------------------------------------- #
|
9
|
+
# This function will take a string and encode it. #
|
10
|
+
# -------------------------------------------------------------------------------- #
|
11
|
+
|
12
|
+
def encode(options)
|
13
|
+
npa = PhoneticEncoder.new
|
14
|
+
|
15
|
+
if options[:dictionary]
|
16
|
+
puts npa.encode(options[:message], options[:dictionary])
|
17
|
+
else
|
18
|
+
puts npa.encode(options[:message])
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# -------------------------------------------------------------------------------- #
|
23
|
+
# Process Arguments #
|
24
|
+
# -------------------------------------------------------------------------------- #
|
25
|
+
# This function will process the input from the command line and work out what it #
|
26
|
+
# is that the user wants to see. #
|
27
|
+
# #
|
28
|
+
# This is the main processing function where all the processing logic is handled. #
|
29
|
+
# -------------------------------------------------------------------------------- #
|
30
|
+
|
31
|
+
def process_arguments
|
32
|
+
options = {}
|
33
|
+
# Enforce the presence of
|
34
|
+
mandatory = %I[message]
|
35
|
+
|
36
|
+
optparse = OptionParser.new do |opts|
|
37
|
+
opts.banner = "Usage: #{File.basename($PROGRAM_NAME)}"
|
38
|
+
|
39
|
+
opts.on('-h', '--help', 'Display this screen') do
|
40
|
+
puts opts
|
41
|
+
exit(1)
|
42
|
+
end
|
43
|
+
|
44
|
+
opts.on('-d', '--dictionary string', 'The dictionary to us') do |dictionary|
|
45
|
+
options[:dictionary] = dictionary
|
46
|
+
end
|
47
|
+
opts.on('-m', '--message string', 'The message to encode') do |message|
|
48
|
+
options[:message] = message
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
begin
|
53
|
+
optparse.parse!
|
54
|
+
missing = mandatory.select { |param| options[param].nil? }
|
55
|
+
raise OptionParser::MissingArgument.new(missing.join(', ')) unless missing.empty?
|
56
|
+
rescue OptionParser::InvalidOption, OptionParser::MissingArgument => e
|
57
|
+
puts e.to_s
|
58
|
+
puts optparse
|
59
|
+
exit(1)
|
60
|
+
end
|
61
|
+
|
62
|
+
encode(options)
|
63
|
+
end
|
64
|
+
|
65
|
+
# -------------------------------------------------------------------------------- #
|
66
|
+
# Main() #
|
67
|
+
# -------------------------------------------------------------------------------- #
|
68
|
+
# The main function where all of the heavy lifting and script config is done. #
|
69
|
+
# -------------------------------------------------------------------------------- #
|
70
|
+
|
71
|
+
def main
|
72
|
+
process_arguments
|
73
|
+
end
|
74
|
+
|
75
|
+
main
|
76
|
+
|
77
|
+
# -------------------------------------------------------------------------------- #
|
78
|
+
# End of Script #
|
79
|
+
# -------------------------------------------------------------------------------- #
|
80
|
+
# This is the end - nothing more to see here. #
|
81
|
+
# -------------------------------------------------------------------------------- #
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'phonetic_encoder/version'
|
2
|
+
require 'phonetic_encoder/dicts/nato.rb'
|
3
|
+
require 'phonetic_encoder/dicts/sounds.rb'
|
4
|
+
|
5
|
+
#
|
6
|
+
# Docs to come
|
7
|
+
#
|
8
|
+
class PhoneticEncoder
|
9
|
+
def initialize
|
10
|
+
@dict = {}
|
11
|
+
|
12
|
+
@dict['nato'] = NATO
|
13
|
+
@dict['sounds'] = SOUNDS
|
14
|
+
end
|
15
|
+
|
16
|
+
def custom(name, dict)
|
17
|
+
@dict[name] = dict
|
18
|
+
end
|
19
|
+
|
20
|
+
def letter_from_dictionary(letter, dict)
|
21
|
+
dict.key?(letter) ? dict[letter].downcase : letter
|
22
|
+
end
|
23
|
+
|
24
|
+
def encode(text, dict_name = 'nato')
|
25
|
+
dict_name = 'nato' if dict_name.empty?
|
26
|
+
|
27
|
+
return text unless @dict.key?(dict_name)
|
28
|
+
|
29
|
+
result = ''
|
30
|
+
|
31
|
+
text.downcase.split('').each do |letter|
|
32
|
+
result << format('%<word>s ', word: letter_from_dictionary(letter, @dict[dict_name]))
|
33
|
+
end
|
34
|
+
result.rstrip
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class PhoneticEncoder
|
2
|
+
NATO = { 'a' => 'alpha',
|
3
|
+
'b' => 'bravo',
|
4
|
+
'c' => 'charlie',
|
5
|
+
'd' => 'delta',
|
6
|
+
'e' => 'echo',
|
7
|
+
'f' => 'foxtrot',
|
8
|
+
'g' => 'golf',
|
9
|
+
'h' => 'hotel',
|
10
|
+
'i' => 'india',
|
11
|
+
'j' => 'juliett',
|
12
|
+
'k' => 'kilo',
|
13
|
+
'l' => 'lima',
|
14
|
+
'm' => 'mike',
|
15
|
+
'n' => 'november',
|
16
|
+
'o' => 'oscar',
|
17
|
+
'p' => 'papa',
|
18
|
+
'q' => 'quebec',
|
19
|
+
'r' => 'romeo',
|
20
|
+
's' => 'sierra',
|
21
|
+
't' => 'tango',
|
22
|
+
'u' => 'uniform',
|
23
|
+
'v' => 'victor',
|
24
|
+
'w' => 'whiskey',
|
25
|
+
'x' => 'x-ray',
|
26
|
+
'y' => 'yankee',
|
27
|
+
'z' => 'zulu' }.freeze
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class PhoneticEncoder
|
2
|
+
SOUNDS = { 'a' => 'aye',
|
3
|
+
'b' => 'bee',
|
4
|
+
'c' => 'sea',
|
5
|
+
'd' => 'dee',
|
6
|
+
'e' => 'ee',
|
7
|
+
'f' => 'eff',
|
8
|
+
'g' => 'jee',
|
9
|
+
'h' => 'aytch',
|
10
|
+
'i' => 'eye',
|
11
|
+
'j' => 'jay',
|
12
|
+
'k' => 'kay',
|
13
|
+
'l' => 'el',
|
14
|
+
'm' => 'em',
|
15
|
+
'n' => 'en',
|
16
|
+
'o' => 'oh',
|
17
|
+
'p' => 'pee',
|
18
|
+
'q' => 'cue',
|
19
|
+
'r' => 'are',
|
20
|
+
's' => 'ess',
|
21
|
+
't' => 'tee',
|
22
|
+
'u' => 'you',
|
23
|
+
'v' => 'vee',
|
24
|
+
'w' => 'doubleyou',
|
25
|
+
'x' => 'ex',
|
26
|
+
'y' => 'why',
|
27
|
+
'z' => 'zed' }.freeze
|
28
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "phonetic_encoder/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "phonetic_encoder"
|
8
|
+
spec.version = PhoneticEncoder::VERSION
|
9
|
+
spec.authors = ["Tim Gurney"]
|
10
|
+
spec.email = ["tim.gurney@timgurney.net"]
|
11
|
+
|
12
|
+
spec.summary = %q{Display the NATO Phonetic name for any given letter or word.}
|
13
|
+
spec.description = %q{A ruby gem to display the NATO Phonetic name for any given letter or word. You can also pass custom dictionaries.}
|
14
|
+
spec.homepage = "https://github.com/WolfSoftware/phonetic_encoder"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: phonetic_encoder
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tim Gurney
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-01-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: A ruby gem to display the NATO Phonetic name for any given letter or
|
56
|
+
word. You can also pass custom dictionaries.
|
57
|
+
email:
|
58
|
+
- tim.gurney@timgurney.net
|
59
|
+
executables:
|
60
|
+
- phonetic_encoder
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- ".gitignore"
|
65
|
+
- ".rspec"
|
66
|
+
- ".rubocop.yml"
|
67
|
+
- ".travis.yml"
|
68
|
+
- CHANGELOG.md
|
69
|
+
- CODEOWNERS
|
70
|
+
- CODE_OF_CONDUCT.md
|
71
|
+
- Gemfile
|
72
|
+
- LICENSE.txt
|
73
|
+
- README.md
|
74
|
+
- Rakefile
|
75
|
+
- bin/console
|
76
|
+
- bin/setup
|
77
|
+
- exe/phonetic_encoder
|
78
|
+
- lib/phonetic_encoder.rb
|
79
|
+
- lib/phonetic_encoder/dicts/nato.rb
|
80
|
+
- lib/phonetic_encoder/dicts/sounds.rb
|
81
|
+
- lib/phonetic_encoder/version.rb
|
82
|
+
- phonetic_encoder.gemspec
|
83
|
+
homepage: https://github.com/WolfSoftware/phonetic_encoder
|
84
|
+
licenses:
|
85
|
+
- MIT
|
86
|
+
metadata: {}
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubygems_version: 3.0.2
|
103
|
+
signing_key:
|
104
|
+
specification_version: 4
|
105
|
+
summary: Display the NATO Phonetic name for any given letter or word.
|
106
|
+
test_files: []
|