public void testParser_EN(String aVariant) { File inputFile = null; File outputDir = null; // generate XMI files for the training data inputFile = new File("./src/main/resources/data-set/English_dev.xml"); assertTrue(inputFile.exists()); outputDir = new File("./target/EN/dev/"); if (!outputDir.exists()) { outputDir.mkdirs(); } assertTrue(outputDir.exists()); LAPAccess lap = null; try { // previously // lap = new MaltParserEN(aVariant); // now either this; if model variants are needed ... HashMap<String, String> descArgs = new HashMap<String, String>(); descArgs.put("PARSER_MODEL_VARIANT", aVariant); lap = new MaltParserEN(descArgs); // or you can say, // lap = new MaltParserEN(); // this will load default model. lap.processRawInputFormat(inputFile, outputDir); } catch (LAPException e) { logger.info(e.getMessage()); } // generate XMI files for the testing data inputFile = new File("./src/main/resources/data-set/English_test.xml"); assertTrue(inputFile.exists()); outputDir = new File("./target/EN/test/"); if (!outputDir.exists()) { outputDir.mkdirs(); } assertTrue(outputDir.exists()); try { lap = new MaltParserEN(); // Default model lap.processRawInputFormat(inputFile, outputDir); } catch (LAPException e) { logger.info(e.getMessage()); } }
public void testParser_DE() { File inputFile = null; File outputDir = null; // generate XMI files for the training data inputFile = new File("./src/main/resources/data-set/German_dev.xml"); assertTrue(inputFile.exists()); outputDir = new File("./target/DE/dev/"); if (!outputDir.exists()) { outputDir.mkdirs(); } assertTrue(outputDir.exists()); LAPAccess lap = null; try { lap = new MaltParserDE(); lap.processRawInputFormat(inputFile, outputDir); } catch (LAPException e) { logger.info(e.getMessage()); } // generate XMI files for the testing data inputFile = new File("./src/main/resources/data-set/German_test.xml"); assertTrue(inputFile.exists()); outputDir = new File("./target/DE/test/"); if (!outputDir.exists()) { outputDir.mkdirs(); } assertTrue(outputDir.exists()); try { lap = new MaltParserDE(); lap.processRawInputFormat(inputFile, outputDir); } catch (LAPException e) { logger.info(e.getMessage()); } }