def test_config_file(self): rouge = Rouge155() rouge.system_dir = add_data_path("systems") rouge.model_dir = add_data_path("models") rouge.system_filename_pattern = "SL.P.10.R.11.SL062003-(\d+).html" rouge.model_filename_pattern = "SL.P.10.R.[A-D].SL062003-#ID#.html" rouge.config_file = add_data_path("config_test.xml") rouge.write_config(system_id=11) self.assertTrue( xml_equal(rouge.config_file, add_data_path("ROUGE-test_11.xml"))) os.remove(rouge.config_file)
def test_config_file(self): rouge = Rouge155() rouge.system_dir = add_data_path("systems") rouge.model_dir = add_data_path("models") rouge.system_filename_pattern = "SL.P.10.R.11.SL062003-(\d+).html" rouge.model_filename_pattern = "SL.P.10.R.[A-D].SL062003-#ID#.html" rouge.config_file = add_data_path("config_test.xml") rouge.write_config(system_id=11) self.assertTrue(xml_equal( rouge.config_file, add_data_path("ROUGE-test_11.xml"))) os.remove(rouge.config_file)
def test_write_config(self): system_dir = add_data_path("systems") model_dir = add_data_path("models") system_filename_pattern = "SL.P.10.R.11.SL062003-(\d+).html" model_filename_pattern = "SL.P.10.R.[A-D].SL062003-#ID#.html" config_file = os.path.join(mkdtemp(), "config_test.xml") command = ( "pyrouge_write_config_file -m {m} -s {s} " "-mfp {mfp} -sfp {sfp} -c {c}".format( m=model_dir, s=system_dir, mfp=model_filename_pattern, sfp=system_filename_pattern, c=config_file)) check_output(command.split()) target_xml = add_data_path("config_test.xml") print(config_file, target_xml) self.assertTrue(xml_equal(config_file, target_xml))
def test_write_config(self): system_dir = add_data_path("systems") model_dir = add_data_path("models") system_filename_pattern = "SL.P.10.R.11.SL062003-(\d+).html" model_filename_pattern = "SL.P.10.R.[A-D].SL062003-#ID#.html" config_file = os.path.join(mkdtemp(), "config_test.xml") command = ("pyrouge_write_config_file -m {m} -s {s} " "-mfp {mfp} -sfp {sfp} -c {c}".format( m=model_dir, s=system_dir, mfp=model_filename_pattern, sfp=system_filename_pattern, c=config_file)) check_output(command.split()) target_xml = add_data_path("config_test.xml") print(config_file, target_xml) self.assertTrue(xml_equal(config_file, target_xml))