Find textonyms, words that map to the same mobile phone keys when sending text messages.

Some mobile phones provide a predictive function when writing text messages so that when you type 'gdjjm' you get the more likely match 'hello'.

Recently I noticed that 'kiss' maps to the same keys as 'lips' and so I wrote the following short program to see if there were any other interesting matches. These are refered to as textonyms apparently.

Run it against a word list as follows:

perl mobile.pl /usr/dict/words

Here are a few of the other interesting collisions:

ANSI Borg darn farm book cool home good rifle shelf babies caches autumn button Jaeger ladies

And here is the program:

#!/usr/bin/perl -wl use strict; my $min = 3; my %words; while (<>) { chomp; next unless length > $min; my $index = lc $_; $index =~ tr[abc def ghi jkl mno pqrs tuv wxyz] [222 333 444 555 666 7777 888 9999]; push @{$words{$index}}, $_; } for my $index (sort {$a <=> $b} keys %words) { my @words = sort @{$words{$index}}; next unless @words > 1; print for '', @words; } __END__

Replies are listed 'Best First'.
Re: Find SMS text matches (textonyms)
by tweetiepooh (Hermit) on Jan 06, 2006 at 16:55 UTC
    Extending this idea a tad. You could use it to encode messages.

    Pass message through textonym encoder, generating "new" words and a key to indicate which option the original is within each set of textonymns.

    Send message and key separately.

    To decode get textonyms for each coded word, use key to select which of these is original.

    Advantages include message doesn't look encrypted so if mail system blocks other forms of encryption this may still work.

    Limitations include both parties need same word list to ensure correct decoding/encoding. Possible that there may be no textonyms for enough words to make encoded message readable.

    Enhancements would be to have unique exchange coding between letter and phone digit. Interceptor would then need 3 parts to get message. The encoded message, encoding key and exchange key.

    OK so it's not very secure but it sounds fun. With some clever coding one may end up with an encoded message that's actually readable too.
Re: Find SMS text matches (textonyms)
by zentara (Cardinal) on Dec 17, 2005 at 12:37 UTC
    We just take for granted the ways the original phone dialing system was setup, it was something most of us were just "born into" . But isn't bizarre that we even have to deal with 3 letters being on the same button? It's one of those bad design descisions that has altered the course of history.

    I'm not really a human, but I play one on earth. flash japh
      The current phone layout is the result of a series of efficiency hacks and is rather interesting.

      I can recommend the Wikipedia articles on telephone numbers and telephone switching as interesting and illuminating.

Re: Find SMS text matches (textonyms)
by Anonymous Monk on Feb 09, 2011 at 09:45 UTC
    Just a minor snag: my /etc/dictionaries-common/words file has apostrophes in it and the numeric sort doesn't like the not-quite-numbers produced by the tr.