Beefy Boxes and Bandwidth Generously Provided by pair Networks
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
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found