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
in thread Perl uses for Cryptograms - Part 1: One-liners and Word Patterns by goibhniu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.