home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!psinntp!jpradley!jpr
- From: jpr@jpradley.jpr.com (Jean-Pierre Radley)
- Subject: Re: word cracker
- Date: Fri, 01 Jan 1993 18:43:50 GMT
- Message-ID: <1993Jan01.184350.24450@jpradley.jpr.com>
- References: <1992Dec30.235126.25601@mnemosyne.cs.du.edu>
- Organization: Unix in NYC
- Lines: 56
-
- In article <1992Dec30.235126.25601@mnemosyne.cs.du.edu> sscrivan@nyx.cs.du.edu (steve scrivano) writes:
- >OK, gurus! Can anyone solve this problem?
- >
- >I am looking for a fairly portable "C" program or script that will produce
- >every possible 4 letter or greater combination using the following
- >letters:
- >
- >c e e f g h i i l l n n o p p r r r s s t t t u
- >
- >
- >Some of the letters appear more than once and therefore will increase the
- >possible number of combinations possible. I realize that the number of
- >combinations are incredible and will probably consume a great deal of
- >cpu time. My intentions are to find every possible word that 4 or more
- >of these letters can create. Each time a letter combination is created,
- >that combination would be compared with /usr/dict/words and if found
- >there it would be concatenated to a resulting word file.
- >
- >The end result would be a word file created with all possible combinations.
- >You might say, sort of a crossword puzzle cracker. It would be ideal if
- >the program could accept input so all I had to do is enter in the letters
- >and it would the job from there although not mandatory.
- >
-
- Here's a script wich filters what you don't want out of /usr/dict/words.
-
- </usr/dict/words tr '[A-Z]' '[a-z]' |
- sed '
- /^.$/d
- /^..$/d
- /^...$/d
- /[abdjkmqv-z0-9]/d
- /c.*c/d
- /e.*.e.*e/d
- /f.*f/d
- /g.*g/d
- /h.*h/d
- /i.*.i.*i/d
- /l.*.l.*l/d
- /n.*.n.*n/d
- /o.*o/d
- /p.*.p.*p/d
- /r.*r.*r.*r/d
- /s.*.s.*s/d
- /t.*t.*t.*t/d
- /u.*u/d
- ' > out.file
-
- Note that /usr/dict words doesn't contain 'called', 'calling', 'calls' ;
- spelling programs know a bit of English, and can construct those once they've
- found 'call' in the file.
-
- I made my own assumption about capitalized words, converting them and keeping
- them.
- --
- Jean-Pierre Radley Unix in NYC jpr@jpr.com jpradley!jpr CIS: 72160.1341
-