good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I discovered this posting from a google search and found it quite interesting. I too have been into solving cryptograms for quite a while. I'm just beginning to try to write a perl script that will solve one automatically. I've found lots of examples in other languages, but none in perl so I'm just trying to absorb as much as I can from a perl perspective and see if I can do it. After reading and studying your code snippets, I thought you might be interested in my approach to getting crypto help. I've been saving every cryptogram I've ever solved in a text file. I then run a very big, clumsy and poorly written perl script to create a number of text files with all the words contained in the quote file. Among the files is a patterns file. I use a format like "1=22=1=" for a word like "suppose" and "=======" (that should be 7 separate consecutive "=" marks) for any 7 letter word with no pattern. I also add the number of occurrences of each word to the pattern file so that after the file is sorted by word length, then by pattern, and finally in descending order by frequency, I can just do a simple grep for a pattern, and I get a list ordered by frequency of occurence, in normal speech (or at least as normal as you can get from a bunch of quotations... ;-). That way I can make my guesses in a fairly productive manner. At any rate, I appreciate what I've learned from your regex statements (regex is not my strongpoint) and thought you might be interested to know how I approach the pattern problem. After poking around on the site for a couple of days, I decided I'd join the monks. Thanks again!
Life is short, but it's wide -- Chuck Pyle
In reply to Re: Perl uses for Cryptograms - Part 1: One-liners and Word Patterns
by duggles
|
|