[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Phone number to words

Jordi Bunster

2/10/2005 12:14:00 AM

Does anyone have one of those algorithms that convert a phone number to
a word, using /usr/share/dict/words, for example?

In Ruby, I mean. ;)

--
Jordi



12 Answers

Bill Guindon

2/10/2005 12:27:00 AM

0

Sounds like it would make a good ruby quiz, and Friday's coming.


On Thu, 10 Feb 2005 09:14:14 +0900, Jordi Bunster <jordi@bunster.org> wrote:
> Does anyone have one of those algorithms that convert a phone number to
> a word, using /usr/share/dict/words, for example?
>
> In Ruby, I mean. ;)
>
> --
> Jordi
>
>


--
Bill Guindon (aka aGorilla)


Joe Van Dyk

2/10/2005 1:20:00 AM

0

On Thu, 10 Feb 2005 09:26:39 +0900, Bill Guindon <agorilla@gmail.com> wrote:
> Sounds like it would make a good ruby quiz, and Friday's coming.
>
>
> On Thu, 10 Feb 2005 09:14:14 +0900, Jordi Bunster <jordi@bunster.org> wrote:
> > Does anyone have one of those algorithms that convert a phone number to
> > a word, using /usr/share/dict/words, for example?
> >
> > In Ruby, I mean. ;)
> >

Heck yeah, that would be a great one. I'd actually do it. :)


Szymon Drejewicz

2/10/2005 9:32:00 AM

0

Jordi Bunster wrote:
> Does anyone have one of those algorithms that convert a phone number to
> a word, using /usr/share/dict/words, for example?
>
> In Ruby, I mean. ;)
>
> --
> Jordi
>
>
>

Do you mean something like:

Speaker.say('888 999 123')
=> eight eight eight nine nine nine one two three

? :-)

--
Sz

Bertram Scharpf

2/10/2005 11:12:00 AM

0

Hi,

Am Donnerstag, 10. Feb 2005, 09:26:39 +0900 schrieb Bill Guindon:
> On Thu, 10 Feb 2005 09:14:14 +0900, Jordi Bunster <jordi@bunster.org> wrote:
> > Does anyone have one of those algorithms that convert a phone number to
> > a word, using /usr/share/dict/words, for example?
>
> Sounds like it would make a good ruby quiz, and Friday's coming.

words = %w(zero one two ...)
number.scan( /[0-9]/).map { |x| words[ x.to_i] }.join ' '

A nice quiz would be saying numbers in French.

Bertram


--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-...


dblack

2/10/2005 11:28:00 AM

0

Tom Rathbone

2/10/2005 11:32:00 AM

0

> > On Thu, 10 Feb 2005 09:14:14 +0900, Jordi Bunster <jordi@bunster.org> wrote:
> > Does anyone have one of those algorithms that convert a phone number to
> > a word, using /usr/share/dict/words, for example?
> >
> > In Ruby, I mean. ;)
> >
> > --
> > Jordi
> >
> >
> On Thu, 10 Feb 2005 09:26:39 +0900, Bill Guindon <agorilla@gmail.com> wrote:
> Sounds like it would make a good ruby quiz, and Friday's coming.
> --
> Bill Guindon (aka aGorilla)

I recently wrote a challenge/quiz for www.osix.net (a nice little
challenge site.. good place to strut your ruby) it hasn't been
released yet but will be shortly. The challenge to to decode a string
of telephone keypresses to words as if composing a message using
predictive-text (T9). Is this what you meant? If so could I ask that
it is held off as a ruby quiz until our challenge has run its course
and the prize winners are announced, release is any day now, runs for
one month.

Tom.

P.S I wrote the original converted in Ruby.. very easy.


Jordi Bunster

2/10/2005 12:43:00 PM

0


On Feb 10, 2005, at 6:27 AM, David A. Black wrote:

> I don't think that's what Jordi meant. I think it's more like:
> convert the numbers to their letter equivalents (2 => a,b,c; 3 =>
> d,e,f; etc. [in the U.S.]), and then see what words you can spell.

Exactly. 1-800-SUETHEM and the like.

--
Jordi



Gavin Kistner

2/10/2005 2:02:00 PM

0

On Feb 10, 2005, at 4:32 AM, Tom Rathbone wrote:
> [...] The challenge to to decode a string
> of telephone keypresses to words as if composing a message using
> predictive-text (T9). Is this what you meant?

No, I believe the OP was just looking for "what fun and memorable
phrase can I tell people to use for my phone number?", not T9.



James Gray

2/10/2005 2:14:00 PM

0

On Feb 9, 2005, at 7:19 PM, Joe Van Dyk wrote:

> On Thu, 10 Feb 2005 09:26:39 +0900, Bill Guindon <agorilla@gmail.com>
> wrote:
>> Sounds like it would make a good ruby quiz, and Friday's coming.
>>
>>
>> On Thu, 10 Feb 2005 09:14:14 +0900, Jordi Bunster <jordi@bunster.org>
>> wrote:
>>> Does anyone have one of those algorithms that convert a phone number
>>> to
>>> a word, using /usr/share/dict/words, for example?
>>>
>>> In Ruby, I mean. ;)
>>>
>
> Heck yeah, that would be a great one. I'd actually do it. :)

You guys know how this system works by now, don't you? :) It somebody
puts a write-up I can use in my inbox, I promise, it'll happen.

I'm currently empty on submitted quizzes too, so the more ideas the
better. Send it in.

James Edward Gray II



Thomas Counsell

2/10/2005 2:21:00 PM

0

For extra usefulness I guess the quiz should give extra marks for
allowing different letter to number substitution schemes... I don't
know of anyone in the UK that does the "what fun and memorable phrase
can I tell people to use for my phone number" "1-800-SUETHEM" thing*,
but mobile phone penetration has reached the point where the majority
of people probably use T9**.

* Off topic, but I've occasionally wondered why it has never caught on
in the UK.
** I've just had a sudden doubt that T9 has a standardised number to
letter map...

On 10 Feb 2005, at 14:02, Gavin Kistner wrote:

> On Feb 10, 2005, at 4:32 AM, Tom Rathbone wrote:
>> [...] The challenge to to decode a string
>> of telephone keypresses to words as if composing a message using
>> predictive-text (T9). Is this what you meant?
>
> No, I believe the OP was just looking for "what fun and memorable
> phrase can I tell people to use for my phone number?", not T9.
>
>