the BLAM page -- Doxygen documentation |
#include <cipher.h>
Public Member Functions | |
nzCipherText () | |
default constructor | |
nzCipherText (string tName) | |
constructor with ciphertext title | |
nzCipherText (string tText, string tName) | |
constructor with text and title | |
void | reset () |
clear text and frequencies | |
void | setName (string tName) |
set ciphertext title | |
void | add (char addChar) |
add a character | |
void | add (int charCode) |
add a character passing its alphabetical index [0-25] | |
void | add (string strIn) |
add a string | |
void | addFile (const char *fName) |
add contents of file fName | |
void | blockPrint () |
print text in blocks of 5 | |
double | getEnglishChi2 () |
get chi2 with respect to frequencies of the English language | |
double | getFrenchChi2 () |
get chi2 with respect to frequencies of the French language | |
double | getUniformChi2 () |
get chi2 with respect to the frequency of random letters (1/26) | |
double | getReflectorChi2 () |
get chi2 with respect to the frequencies of a reflector-based cipher machine | |
string | str () |
return text as string | |
void | writeFreqTable (const char *outFile) |
write frequency table to file | |
Private Member Functions | |
string | stripText (string strIn) |
remove all non-alphabetical characters, convert all to lowercase | |
string | identify () |
identify language, based on minimal chi2 | |
int | getMinIndex (vector< double > vect) |
return index of smallest vector entry | |
Private Attributes | |
string | text |
the text proper | |
string | name |
title of the ciphertext (eg NeMa ciphertext, english plaintext, ...) | |
int | freq [26] |
letter frequencies of the text |
|
default constructor
|
|
constructor with ciphertext title
|
|
constructor with text and title
|
|
add a string
|
|
add a character passing its alphabetical index [0-25]
|
|
add a character
|
|
add contents of file fName
|
|
print text in blocks of 5
|
|
get chi2 with respect to frequencies of the English language
|
|
get chi2 with respect to frequencies of the French language
|
|
return index of smallest vector entry
|
|
get chi2 with respect to the frequencies of a reflector-based cipher machine
|
|
get chi2 with respect to the frequency of random letters (1/26)
|
|
identify language, based on minimal chi2
|
|
clear text and frequencies
|
|
set ciphertext title
|
|
return text as string
|
|
remove all non-alphabetical characters, convert all to lowercase
|
|
write frequency table to file
|
|
letter frequencies of the text
|
|
title of the ciphertext (eg NeMa ciphertext, english plaintext, ...)
|
|
the text proper
|