|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthcrypto.analyzer.CryptoAnalyzer
hcrypto.analyzer.WordBasedAnalyzer
public class WordBasedAnalyzer
Analyzes traditional cryptograms of the sort you find in the newspaper. It assumes the text is a word-delimited cryptogram created using a simple substitution cipher. Credits: The algorithm here is based on the algorithm reported by George W. Hart in To decode short cryptograms, CACM 37(9), Sept. 1994, 102-108. At present this analyzer only works for the alphabet 'a' to 'z'. To compile and run from the TestAnalyzer application: cd ~crypto/hcryptoj/1.4/applications/testanalyzer javac -classpath ../../classes -d ../../classes ../../source/hcrypto/analyzer/NgramAnalyzer.java java -classpath ../../classes:. TestAnalyzer analyzers.NgramAnalyzer ga_paramfiles ngram.cgrams.txt
| Field Summary |
|---|
| Fields inherited from class hcrypto.analyzer.CryptoAnalyzer |
|---|
PERMUTATION, PLAYFAIR, RAILFENCE, SIMPLESUB |
| Fields inherited from interface hcrypto.analyzer.Analyzer |
|---|
DECIPHER_LIMIT |
| Constructor Summary | |
|---|---|
WordBasedAnalyzer()
|
|
WordBasedAnalyzer(GaParameters params,
AnalyzerFrame f)
WordBasedAnalyzer() -- this constructor is given an object containing parameter settings |
|
| Method Summary | |
|---|---|
void |
doAnalysis()
This method performs an analysis of the text. |
java.lang.String |
getReport()
This method is part of the Analyzer interface. |
void |
init()
This method is called by setup(). |
void |
run()
This method is part of the Analyzer interface. |
void |
setup(java.lang.String text)
This method initializes the Analyzer. |
java.lang.String |
toString()
This method returns the report generated by the analysis. |
| Methods inherited from class hcrypto.analyzer.CryptoAnalyzer |
|---|
prettyPrint, setup, stopThread, threadIsStopped |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WordBasedAnalyzer(GaParameters params,
AnalyzerFrame f)
params - -- an object containing param1=val1 param2=val2 ...public WordBasedAnalyzer()
| Method Detail |
|---|
public void setup(java.lang.String text)
setup in interface Analyzersetup in class CryptoAnalyzertext - a String pointing to the text being analyzedpublic void init()
public void run()
run in interface Analyzerrun in interface java.lang.Runnablerun in class CryptoAnalyzerpublic java.lang.String getReport()
getReport in interface AnalyzergetReport in class CryptoAnalyzerpublic java.lang.String toString()
toString in class CryptoAnalyzerpublic void doAnalysis()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||