hcrypto.analyzer.tool
Class Dictionary
java.lang.Object
hcrypto.analyzer.tool.Dictionary
- Direct Known Subclasses:
- PatternDictionary
public class Dictionary
- extends java.lang.Object
Implements a searchable dictionary that can be used
by cryptanalysis objects. Each entry in the dictionary consists
of a word and its relative frequency. The frequency is stored
as an int represented as a String. For example,
"the" "38940"
"a" "32901"
To Test: java Dictionary /usr/share/lib/dict/words *
|
Constructor Summary |
Dictionary()
The default constructor reads words from the Unix
word list. |
Dictionary(java.lang.String filename)
|
Dictionary(java.lang.String filename,
boolean linebreaks)
Creates a dictionary from the named file. |
Dictionary(java.lang.String filename,
boolean linebreaks,
int minfreq)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BIG_DICT
public static final int BIG_DICT
- See Also:
- Constant Field Values
KUCERA_340
public static final int KUCERA_340
- See Also:
- Constant Field Values
KUCERA_100
public static final int KUCERA_100
- See Also:
- Constant Field Values
KUCERA_50
public static final int KUCERA_50
- See Also:
- Constant Field Values
KUCERA_3500
public static final int KUCERA_3500
- See Also:
- Constant Field Values
MIN_FREQ
public static final int MIN_FREQ
- See Also:
- Constant Field Values
Dictionary
public Dictionary()
- The default constructor reads words from the Unix
word list.
Dictionary
public Dictionary(java.lang.String filename)
Dictionary
public Dictionary(java.lang.String filename,
boolean linebreaks)
- Creates a dictionary from the named file.
If linebreaks is true, it assumes the words are listed one
per line. Otherwise, it assumes words are listed several per line.
- Parameters:
filename - a String giving the name of the dictionary filelinebreaks - set to true iff the words are listed one per line
Dictionary
public Dictionary(java.lang.String filename,
boolean linebreaks,
int minfreq)
getDictionaryName
public java.lang.String getDictionaryName()
contains
public boolean contains(java.lang.String word)
getFreq
public double getFreq(java.lang.String word)
size
public int size()
getDescriptor
public java.lang.String getDescriptor(int i)
main
public static void main(java.lang.String[] args)