Some code to help you remember numbers

January 17, 2012

(This article was first published on Decision Science News » R, and kindly contributed to R-bloggers)


Two posts ago we showed you the digit sound system for remembering numbers. This week we provide two Python programs (and one R program) to help you create mnemonics. – converts every word in the English language to a number – takes a longish number and gives you words that when put together translate into that number using the digit-sound system.

If you are not a programmer, or if you are lazy, you can get to the chase and just download the relevant outupt files here

wordNum.txt – every word in English translated into a number using the digit-sound system
numWords.txt – All the English words that translate into a given number

However, you have a long number that you want to make a mnemonic for, you’re better off using or find.R below to find mnemonics. These handy programs break up long numbers into shorter ones which do have mnemonics.

These programs use phonetics (not spelling) to make the mnemonics. Read the small print on Jap Murre’s site to see why “letter” is 514 and not 5114 and why “ing” is 27. Thanks to Daniel Reeves for convincing discussions on the merits of using a purely phonetic system.

As usual, we’re open for suggestions on how to improve these programs … they’re both kind of slapdash jobs.
Prerequisites: You need to save a couple of wordlists locally. In particular
1) You need to save a copy of
as cmudict-0.4.scm. This is a mapping from words in English to phonemes.
2) You need to save a copy of
as wordlist.txt. This is a list of reasonably common English words (b/c some of the words in cmudict are too rare to be useful).
3) Put cmudict-0.4.scm and wordlist.txt in the same directory as and then do
python > wordNum.txt
to generate the number corresponding to every English word. (If in the future these URLs break, just search around for copies of cmudict-0.4.scm and 2of12inf.txt …there are many copies of these dictionaries around.)
This is the program you use when you have a longish number and you want to find words that encode it. It uses recursive ™ technology to break up numbers a few different ways to increase your chances of finding a mnemonic you like.
Prerequisite: You must have created wordNum.txt (by running python > wordNum.txt) in the previous step and saved it to the same directory as this program before running.
To turn a number like 8675309 into words do
python 8675309

Lastly, for kicks I wrote a slightly dumber version of in R. It lacks the cool “rec3″ method of finding mnemonics but it gets the job done.

Same as
Prerequisite: same as
To turn a number like 8675309 into words change the variable mstr to ’8675309′ and run the program.

To leave a comment for the author, please follow the link and comment on their blog: Decision Science News » R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , , , , , , , , , , , , , , , , , ,

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)