0
我有一个变量,其中包含一个文本和p标签的字符串,其中p标签指示不同的段落。我想从这个变量中得到一个总结。我找到了一个看起来很容易使用的图书馆。不过,我似乎无法使它与我的变量一起工作。它似乎只使用ob_get_content工作?从变量而不是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();
好的,谢谢你,但是当你运行它时总结长度也是0? – 2015-04-06 12:56:52
是的。但我不知道这样的“总结”是什么,因此我不能说这是否正确。无论如何,这不在这个问题的范围之内,不是吗? – arkascha 2015-04-06 13:00:14
是超出范围。谢谢 – 2015-04-06 13:08:35