Letters to keypad numbers and vice versa.

Log in to Vote
7
7 Votes • 14 Comments
When you type in a number with letters (ex. 1-800-FUN-HACK), it should tell you what "FUN HACK" is on the keypad. This is a goodie, as it does not need an API.
Source:
N/A
• posted 3 years and 1 month ago • type: Goodie (Perl functions) Live

nishanths
We may not need an API as a letter maps to the same number always. For example, F => 3. I'd love to make this as a Goodie sometime around Christmas unless someone starts earlier!

Would also be awesome to do the reverse (i.e. get easy to remember English words for a an input phone number)
posted by nishanths 3 years and 1 month ago Link
javathunderman
Oh, ok. That makes things easier then!
posted by javathunderman Community Leader3 years and 1 month ago Link
steve.lippert
I have a pull request waiting for this idea. I know I may have stepped out of line here, but I was looking for something to get my feet wet with. Turns out this was very similar to the Phonetic Goodie and was simple enough to do the first part, going from 1-800-fun-hack to 1-800-386-4225.
posted by steve.lippert 3 years and 1 month ago Link
steve.lippert
The pull request has been reviewed and they've asked for some changes to the code. I'll be working on this tonight after work.
posted by steve.lippert 3 years and 1 month ago Link
youri
No need for an API indeed to convert digits with letters to digits.

How would you trigger the goodie? How do you identify a valid phone number with digits and letters (e.g. we don't have that in Europe, I think it's mainly North America)?

Does the reverse operation make sense? I suppose you usually start with letters pertaining to your business (LAWYR-UP or something), then you try to obtain one of the matching phone numbers. Not the other way around, no?
posted by youri 3 years and 1 month ago Link
javathunderman
We could trigger it by saying, "1-800-LAWYR-UP to digits", but reverse operation doesn't seem as nice. If you say "1-800-123-4567 to letters", it would have to give you a bunch of possible letters (ex. 1-800-ABC-EFGH or 1-800-AAA-EEEH). Could there be a way around this?
posted by javathunderman Community Leader3 years and 1 month ago Link
takumf
It seems like Scrabble problem with powerful restriction of having sets of 3-4 letters in order. Since the number of possible matches is fairly small (lets even take worst case scenario of 4^7th with a lot of numbers returning 'no match' or something similar), maybe it all could be generated and referenced later? Implementing solution set referenced with some Scrabble words database and later filled up with some non-words that are actually used as numbers.

Sorry if it seems unreasonable after all. I'm new in here and wanted to throw idea out.
posted by takumf 3 years and 1 month ago Link
javathunderman
@takumf No worries! Welcome to Duck.co!

I'm probably going to leave that reversed part out (1-800-1234-567 to letters) and just do it one way.

Any possible ways around this?
posted by javathunderman Community Leader3 years and 1 month ago Link
takumf
Letters to numbers? I would try mapping, honestly. There is currently one standard keymap and some older that are less frequent. Keys corresponding to 0 and 1 are not used anyway.

Here is a little snippet in Python that can be probably done far easier, but I'm sleepy as hell ;P
posted by takumf 3 years and 1 month ago Link
javathunderman
Well, this needs to all be done in Perl... I think that the best way would just be to say that A, B, or C= 2... I'm working on this. It'll be on Github sooner or later.
posted by javathunderman Community Leader3 years and 1 month ago Link
anonymous
Phonewords do also exist in germany, which is in europe ;-)
posted by <hidden> • 2 years and 11 months ago Link
javathunderman
Was working on another goodie...can we get a new dev to work on this?
posted by javathunderman Community Leader3 years and 4 days ago Link
Moollaza
Hey everyone,

Just FYI the first half of this Goodie has been implemented and should go live shortly (whenever we deploy next). It handles conversions from Phone Words -> Digits is done :)

This should work soon: https://duckduckgo.com/?q=to+digits+1-80...
posted by Moollaza Staff2 years and 11 months ago Link
javathunderman
Nice!
posted by javathunderman Community Leader2 years and 11 months ago Link