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
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
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)
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
Heck yeah, that would be a great one. I'd actually do it. ![]()
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.
>
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-scharpf.de
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.
> 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)
Hi --
Hi,
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 ' '
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.
Just for fun, though, here's another way to do yours:
require 'scanf'
number.scanf("%1d") {|n,| words[n] }.join(" ")
David
On Thu, 10 Feb 2005, Bertram Scharpf wrote:
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:
--
David A. Black
dblack@wobblini.net
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.
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?
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
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.
Exactly. 1-800-SUETHEM and the like.
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.
--
Jordi
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.
Yes. Q is on 7 and Z is on 9. Beyond that, it's the standard telephone key map.
-austin
On Thu, 10 Feb 2005 23:21:17 +0900, Thomas Counsell <tamc2@cam.ac.uk> wrote:
** I've just had a sudden doubt that T9 has a standardised number to
letter map...
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca
Hi,
Am Donnerstag, 10. Feb 2005, 21:42:47 +0900 schrieb Jordi Bunster:
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.
Seems to be no real challenge either.
<http://projects.bertram-scharpf.de/tmp/phonetoword.rb>
What happens to the 0 and 1 digits?
Bertram
--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de