public class Packer
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
block |
protected int |
count |
protected java.lang.String[] |
data |
protected java.io.RandomAccessFile |
dataFile |
protected java.io.RandomAccessFile |
hashFile |
protected PackerHeader |
header |
protected int[] |
hwms |
protected java.io.RandomAccessFile |
indexFile |
static int |
INTSIZ |
protected java.lang.String |
lastWord |
static int |
MAGIC |
static int |
MAXBLOCKLEN |
static int |
MAXWORDLEN |
protected java.lang.String |
mode |
static int |
NUMWORDS |
static int |
STRINGSIZE |
static int |
TRUNCSTRINGSIZE |
| Constructor and Description |
|---|
Packer(java.lang.String name,
java.lang.String mode) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
find(java.lang.String s) |
private void |
flush() |
java.lang.String |
get(int num) |
static void |
main(java.lang.String[] args) |
static void |
make(java.io.InputStream in,
java.lang.String outFilename,
boolean log)
Reads a word list from in and writes a set of dictionary files
out which are prefixed with outFilename.
|
void |
put(java.lang.String s) |
int |
size() |
static void |
usage() |
public static final int MAGIC
public static final int STRINGSIZE
public static final int TRUNCSTRINGSIZE
public static final int NUMWORDS
public static final int MAXWORDLEN
public static final int MAXBLOCKLEN
public static final int INTSIZ
protected java.io.RandomAccessFile dataFile
protected java.io.RandomAccessFile indexFile
protected java.io.RandomAccessFile hashFile
protected java.lang.String mode
protected PackerHeader header
protected int[] hwms
protected int count
protected java.lang.String lastWord
protected java.lang.String[] data
protected int block
public Packer(java.lang.String name,
java.lang.String mode)
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
java.io.IOExceptionpublic void put(java.lang.String s)
throws java.io.IOException
java.io.IOExceptionprivate void flush()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String get(int num)
throws java.io.IOException
java.io.IOExceptionpublic int find(java.lang.String s)
throws java.io.IOException
java.io.IOExceptionpublic int size()
public static final void make(java.io.InputStream in,
java.lang.String outFilename,
boolean log)
throws java.io.IOException
in - The word list to read in.outFilename - The path and filename prefix for the new
on-disk dictionary.log - If true, we'll write to stdout as we create load the
words from in.java.io.IOExceptionpublic static final void usage()
public static final void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception