我有一个变量,其中包含一串文本和 p 标签,其中 p 标签表示不同的段落。我想要从这个变量中创建一个摘要。我找到了一个看起来很容易使用的库。但是我似乎无法让它与我的变量一起使用。它似乎只能使用 ob_get_content 工作?
图书馆: https ://github.com/freekrai/summarizer
到目前为止,我已经尝试过了,它似乎没有像在演示中那样返回摘要?
$full_text_strip = "<p>Counter-Strike: Global Offensive majors have a history of spurring serious roster overhauls. The moves following the results of ESL Katowice continue to reinforce tradition.</p><p>Penta Sports proved many doubters wrong by following up its first top-eight finish at a major at DreamHack Winter late last year with another top-eight finish at ESL Katowice. While the German squad did fall in the quarterfinal round to eventual champion Fnatic, the team proved without a doubt to be the best in Germany and among the best in Europe.</p>"
$st = new Summarizer();
$summary = $st->get_summary($full_text_strip);
echo $summary;
echo $st->how_we_did();