def test_read_summary(self): #<html> #<head> #<title>SL.P.10.R.A.SL062003-01</title> #</head> #<body bgcolor="white"> #<a name="1">[1]</a> <a href="#1" id=1>Poor nations demand trade subsidies from developed nations.</a> #</body> #</html> summary_fname = os.path.join(DATA_DIR, "models/SL.P.10.R.A.SL062003-01.html") summary = Doc.from_see(open(summary_fname).read()) self.assertEqual(summary.id, "SL.P.10.R.A.SL062003-01") self.assertEqual(len(summary.sents), 1) first_sent = summary.sents[0] self.assertEqual(first_sent.text, "Poor nations demand trade subsidies from developed nations.")
def test_read_summary(self): #<html> #<head> #<title>SL.P.10.R.A.SL062003-01</title> #</head> #<body bgcolor="white"> #<a name="1">[1]</a> <a href="#1" id=1>Poor nations demand trade subsidies from developed nations.</a> #</body> #</html> summary_fname = os.path.join(DATA_DIR, "models/SL.P.10.R.A.SL062003-01.html") summary = Doc.from_see(open(summary_fname).read()) self.assertEqual(summary.id, "SL.P.10.R.A.SL062003-01") self.assertEqual(len(summary.sents), 1) first_sent = summary.sents[0] self.assertEqual( first_sent.text, "Poor nations demand trade subsidies from developed nations.")
def sl2003_summary(kind, filename): summary_dir = os.path.join(SL2003_DIR, kind) summary_contents = open(os.path.join(summary_dir, filename)).read() return Doc.from_see(summary_contents)
def sl2003_summary(kind, filename): summary_dir = os.path.join(SL2003_DIR, kind) summary_contents = open(os.path.join(summary_dir, filename)).read() return Doc.from_see(summary_contents)