* @param spec a propagation specification
* @param dataFormatInstance a data format instance
* @throws MaltChainedException
*/
public Propagation(PropagationSpec spec, DataFormatInstance dataFormatInstance) throws MaltChainedException {
ColumnDescription fromColumn = dataFormatInstance.getColumnDescriptionByName(spec.getFrom());
if (fromColumn == null) {
throw new PropagationException("The symbol table '"+spec.getFrom()+" does not exists.");
}
fromTable = fromColumn.getSymbolTable();
ColumnDescription toColumn = dataFormatInstance.getColumnDescriptionByName(spec.getTo());
if (toColumn == null) {
toColumn = dataFormatInstance.addInternalColumnDescription(spec.getTo(), fromColumn);
toTable = toColumn.getSymbolTable();
}
forSet = new TreeSet<String>();
if (spec.getFor() != null && spec.getFor().length() > 0) {
String[] items = spec.getFor().split("\\|");
for (String item : items) {
forSet.add(item);
}
}
overSet = new TreeSet<String>();
if (spec.getOver() != null && spec.getOver().length() > 0) {
String[] items = spec.getOver().split("\\|");
for (String item : items) {
overSet.add(item);
}
}
ColumnDescription deprelColumn = dataFormatInstance.getColumnDescriptionByName("DEPREL");
deprelTable = deprelColumn.getSymbolTable();
symbolSeparator = Pattern.compile("\\|");
}