ph_no_to_word
allows given 10 character phone number to convert into a word that is contained in the dictionary.
The phone number should not contain 0 or 1. The matching words contain atleast 3 characters.
You can find the dictionary file here: https://github.com/abhilashak/dictionary_file/blob/master/dictionary.txt
Add this line to your application's Gemfile:
gem 'ph_no_to_word'
And then execute
$ bundle
Or install it by yourself
$ gem install ph_no_to_word
After installing the gem do
irb(main):001:0> require 'ph_no_to_word'
=> true
irb(main):002:0> PhNoToWord.convert "2282668687"
=> ["act, amounts", "act, boo, tots", "act, boo, tour", "act, boot, mus",
....... "cat, coot, mus", "cat, coot, nus", "cat, coot, our", "catamounts"]
Results:
* act, amounts
* act, boo, tots
* act, boo, tour
* act, boot, mus
* act, boot, nus
* act, boot, our
* act, con, tots
* act, con, tour
* act, contour
.......
.......
* cat, con, tour
* cat, contour
* cat, coo, tots
* cat, coo, tour
* cat, coot, mus
* cat, coot, nus
* cat, coot, our
* catamounts
irb(main):004:0> PhNoToWord.convert '6686787825'
=> ["act, amounts", "act, boo, tots", "act, boo, tour", "act, boot, mus",
....."oot, orts, taj", "motor, truck", "motor, usual", "motortruck", "nouns, truck","nouns, usual"]
Results:
* act, amounts
* act, boo, tots
* act, boo, tour
* act, boot, mus
* act, boot, nus
* act, boot, our
* act, con, tots
.......
.......
* motortruck
* motor, truck
* motor, usual
* mot, opt, puck
* mot, opt, ruck
* mot, opt, suck
* noun, struck
* not, opt, puck
Bug reports and pull requests are welcome on Github at https://github.com/abhilashak/ph_no_to_word. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the PhNoToWord project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.