{"id":3064,"date":"2012-01-17T19:07:27","date_gmt":"2012-01-18T00:07:27","guid":{"rendered":"http:\/\/www.decisionsciencenews.com\/?p=3064"},"modified":"2012-01-19T12:02:32","modified_gmt":"2012-01-19T17:02:32","slug":"some-code-to-help-you-remember-numbers","status":"publish","type":"post","link":"https:\/\/www.decisionsciencenews.com\/?p=3064","title":{"rendered":"Some code to help you remember numbers"},"content":{"rendered":"<p>HANDY COMPUTER PROGRAMS FOR TURNING NUMBERS INTO MEMORABLE WORDS<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2012\/01\/mmo.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3066\" title=\"mmo\" src=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2012\/01\/mmo.jpg\" alt=\"\" width=\"485\" height=\"538\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.decisionsciencenews.com\/2012\/01\/06\/how-to-remember-numbers\/\">Two posts ago<\/a> we showed you the <a href=\"http:\/\/memory.uva.nl\/memimprovement\/eng\/phon_peg_1.htm\">digit sound system<\/a> for remembering numbers. This week we provide two <a href=\"http:\/\/python.org\/\">Python<\/a> programs (and one <a href=\"http:\/\/www.r-project.org\/\">R<\/a> program) to help you create mnemonics.<\/p>\n<p>w2num.py &#8211; converts every word in the English language to a number<br \/>\nfind.py &#8211; takes a longish number and gives you words that when put together translate into that number using the <a href=\"http:\/\/memory.uva.nl\/memimprovement\/eng\/phon_peg_1.htm\">digit-sound system<\/a>.<\/p>\n<p>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<\/p>\n<p><a href=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2012\/01\/wordNum.zip\">wordNum.txt<\/a> &#8211; every word in English translated into a number using the digit-sound system<br \/>\n<a href=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2012\/01\/numWords.zip\">numWords.txt<\/a> &#8211; All the English words that translate into a given number<\/p>\n<p>However, you have a long number that you want to make a mnemonic for, you&#8217;re better off using find.py or find.R below to find mnemonics. These handy programs break up long numbers into shorter ones which do have mnemonics.<\/p>\n<p>NOTES:<br \/>\nThese programs use phonetics (not spelling) to make the mnemonics. Read the small print on <a href=\"http:\/\/memory.uva.nl\/memimprovement\/eng\/phon_peg_1.htm\">Jap Murre&#8217;s site<\/a> to see why &#8220;letter&#8221; is 514 and not 5114 and why &#8220;ing&#8221; is 27. Thanks to <a href=\"http:\/\/beeminder.com\">Daniel Reeves<\/a> for convincing discussions on the merits of using a purely phonetic system.<\/p>\n<p>As usual, we&#8217;re open for suggestions on how to improve these programs &#8230; they&#8217;re both kind of slapdash jobs.<\/p>\n<p>##w2num.py##<br \/>\nPrerequisites: You need to save a couple of wordlists locally. In particular<br \/>\n1) You need to save a copy of <a href=\"http:\/\/bit.ly\/xz8YIC\">http:\/\/bit.ly\/xz8YIC<\/a><br \/>\nas cmudict-0.4.scm. This is a mapping from words in English to phonemes.<br \/>\n2) You need to save a copy of<a href=\"http:\/\/scrapmaker.com\/data\/wordlists\/twelve-dicts\/2of12inf.txt\"> http:\/\/scrapmaker.com\/data\/wordlists\/twelve-dicts\/2of12inf.txt<\/a><br \/>\nas 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).<br \/>\n3) Put cmudict-0.4.scm and wordlist.txt in the same directory as<br \/>\nw2num.py and then do<br \/>\npython w2num.py &gt; wordNum.txt<br \/>\nto 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 &#8230;there are many copies of these dictionaries around.)<\/p>\n<p><script src=\"https:\/\/gist.github.com\/1640724.js\"> <\/script><\/p>\n<p>##find.py##<br \/>\nThis is the program you use when you have a longish number and you want to find words that encode it. It uses recursive &#8482; technology to break up numbers a few different ways to increase your chances of finding a mnemonic you like.<br \/>\nPrerequisite: You must have created wordNum.txt (by running python w2num.py &gt; wordNum.txt) in the previous step and saved it to the same directory as this program before running.<br \/>\nTo turn a number like 8675309 into words do<br \/>\npython find.py 8675309<\/p>\n<p><script src=\"https:\/\/gist.github.com\/1640971.js\"> <\/script><\/p>\n<p>Lastly, for kicks I wrote a slightly dumber version of find.py in R. It lacks the cool &#8220;rec3&#8221; method of finding mnemonics but it gets the job done.<\/p>\n<p>##find.R##<br \/>\nSame as find.py<br \/>\nPrerequisite: same as find.py<br \/>\nTo turn a number like 8675309 into words change the variable mstr to &#8216;8675309&#8217; and run the program.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/1640988.js\"> <\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Two posts ago we showed you the digit sound system for remembering numbers. This week we provide two computer programs to help you create mnemonics.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[4,16,13,74],"tags":[312,20,314,318,22,203,311,310,317,313,315,319,36,320,1208,78,316],"class_list":["post-3064","post","type-post","status-publish","format-standard","hentry","category-encyclopedia","category-ideas","category-programs","category-r","tag-cognition","tag-decision-making","tag-digit","tag-digit-sound","tag-heuristics","tag-judgment","tag-learning","tag-memory","tag-method","tag-mnemonic","tag-phonetic","tag-phonetic-mnemonic","tag-psychology","tag-python","tag-r","tag-rules","tag-sound"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4LKj-Nq","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts\/3064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3064"}],"version-history":[{"count":37,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts\/3064\/revisions"}],"predecessor-version":[{"id":3113,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts\/3064\/revisions\/3113"}],"wp:attachment":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}