File size: 920 Bytes
6f3ebfa | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | package org.maltparser.parser.transition;
import org.maltparser.core.exception.MaltChainedException;
import org.maltparser.core.helper.HashMap;
import org.maltparser.core.symbol.Table;
import org.maltparser.core.symbol.TableHandler;
/**
*
* @author Johan Hall
**/
public class TransitionTableHandler implements TableHandler {
private final HashMap<String, TransitionTable> transitionTables;
public TransitionTableHandler() {
transitionTables = new HashMap<String, TransitionTable>();
}
public Table addSymbolTable(String tableName) throws MaltChainedException {
TransitionTable table = transitionTables.get(tableName);
if (table == null) {
table = new TransitionTable(tableName);
transitionTables.put(tableName, table);
}
return table;
}
public Table getSymbolTable(String tableName) throws MaltChainedException {
return transitionTables.get(tableName);
}
}
|