graph = new MappablePhraseStructureGraph(symbolTables);
final DataFormatInstance inFormat = configDir.getDataFormatInstance(dataFormatManager.getInputDataFormatSpec().getDataFormatName());
final DataFormatInstance outFormat = configDir.getDataFormatInstance(dataFormatManager.getOutputDataFormatSpec().getDataFormatName());
if (inFormat != null && outFormat != null) {
LosslessMapping mapping = null;
if (inFormat.getDataFormarSpec().getDataStructure() == DataStructure.DEPENDENCY) {
mapping = new LosslessMapping(inFormat, outFormat);
} else {
mapping = new LosslessMapping(outFormat, inFormat);
}
if (inFormat.getDataFormarSpec().getDataStructure() == DataStructure.PHRASE) {
mapping.setHeadRules(OptionManager.instance().getOptionValue(getOptionContainerIndex(), "graph", "head_rules").toString());
}
((MappablePhraseStructureGraph)graph).setMapping(mapping);
} else {
throw new FlowException("Couldn't determine the input and output data format. ");
}