//===============================================================
public static void main(String[] args) throws IOException, ClassNotFoundException {
Vocabulary symbolTable;
Corpus corpusArray;
Suffixes suffixArray;
FrequentPhrases frequentPhrases;
if (args.length == 1) {
String corpusFileName = args[0];
logger.info("Constructing vocabulary from file " + corpusFileName);
symbolTable = new Vocabulary();
int[] lengths = Vocabulary.initializeVocabulary(corpusFileName, symbolTable, true);
logger.info("Constructing corpus array from file " + corpusFileName);
corpusArray = SuffixArrayFactory.createCorpusArray(corpusFileName, symbolTable, lengths[0], lengths[1]);
logger.info("Constructing suffix array from file " + corpusFileName);
suffixArray = new SuffixArray(corpusArray, Cache.DEFAULT_CAPACITY);
} else if (args.length == 3) {
String binarySourceVocabFileName = args[0];
String binaryCorpusFileName = args[1];
String binarySuffixArrayFileName = args[2];
if (logger.isLoggable(Level.INFO)) logger.info("Constructing source language vocabulary from binary file " + binarySourceVocabFileName);
ObjectInput in = BinaryIn.vocabulary(binarySourceVocabFileName);
symbolTable = new Vocabulary();
symbolTable.readExternal(in);
logger.info("Constructing corpus array from file " + binaryCorpusFileName);
if (logger.isLoggable(Level.INFO)) logger.info("Constructing memory mapped source language corpus array.");
corpusArray = new MemoryMappedCorpusArray(symbolTable, binaryCorpusFileName);