@@ -0,0 +1,1142 @@
+package joshua.decoder.ff.lm.srilm;%0D%0A%0D%0Aimport java.io.IOException;%0D%0A%0D%0Aimport joshua.corpus.SymbolTable;%0D%0Aimport joshua.decoder.SrilmSymbol;%0D%0A%0D%0A%0D%0A%0D%0Apublic class VocabularyWriter %7B%0D%0A%09%0D%0A%09public static void main(String%5B%5D args) throws IOException %7B%0D%0A%09%09//=== command options%0D%0A%09%09if (args.length != 3) %7B%0D%0A%09%09%09System.out.println(%22wrong command, correct command should be: java VocabularyWriter lmFile lmOrder outVocabFile%22);%0D%0A%09%09%09System.exit(1);%0D%0A%09%09%7D%09%09%0D%0A%09%09String lmFile = args%5B0%5D.trim();%0D%0A%09%09int lmOrder = new Integer(args%5B1%5D.trim());%0D%0A%09%09String outVocabFile = args%5B2%5D.trim();%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09//=== load the lm file so that the SRI toolkit will set up the map%0D%0A%09%09/**Lane: the loading of a hugh LM might be slow, to speed up, you may just try to set lmOrder=1, regardless of the true order of the lmFile; %0D%0A%09%09 * But, you should verify if the table is exactly the same as if you have load the full-order LM%0D%0A%09%09 **/  %0D%0A%09%09SymbolTable symbolTable = new SrilmSymbol(null, lmOrder);%0D%0A%09%09LMGrammarSRILM lmGrammar  = new LMGrammarSRILM((SrilmSymbol)symbolTable, lmOrder, lmFile);%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09//=== write the map%0D%0A%09%09srilm.write_default_vocab_map(outVocabFile);%0D%0A%09%7D%0D%0A%09%0D%0A%7D%0D%0A

add VocabularyWriter