private void initializeMainTranslationGrammar() throws IOException {
if (logger.isLoggable(Level.INFO))
logger.info("Using grammar read from file " + JoshuaConfiguration.tm_file);
MemoryBasedBatchGrammar gr = new MemoryBasedBatchGrammar(
JoshuaConfiguration.tm_format,
JoshuaConfiguration.tm_file,
this.symbolTable,
JoshuaConfiguration.phrase_owner,
JoshuaConfiguration.default_non_terminal,
JoshuaConfiguration.span_limit,
JoshuaConfiguration.oovFeatureCost);
this.grammarFactories.add(gr);
if(JoshuaConfiguration.useRuleIDName){
if(this.ruleStringToIDTable==null)
this.ruleStringToIDTable = new HashMap<String,Integer>();
gr.obtainRulesIDTable(this.ruleStringToIDTable, this.symbolTable);
}
}