Examples of LosslessMapping


Examples of org.maltparserx.core.syntaxgraph.ds2ps.LosslessMapping

        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. ");
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.