-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
31 lines (21 loc) · 730 Bytes
/
test.php
File metadata and controls
31 lines (21 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require_once('vendor/autoload.php');
$document = new Aboustayyef\Summarizer;
$document->text = <<<EOD
This is where you put a text. It can include <em>tags</em>. But they will be removed.
EOD;
echo $document->summarize(2); // number is sentence limit
//
// $sentences = $document->sentences;
// $document->top_scoring_sentences(5);
// echo "Sorted in order of appearance: \n";
// $orderOfAppearance = $document->top_scoring_sentences(5);
// var_dump($orderOfAppearance);
// echo "Sorted in order of strength: \n";
// var_dump($document->top_scoring_sentences(5,false));
// $paragraph = "";
// foreach ($orderOfAppearance as $sentence => $position) {
// $paragraph .= $sentence;
// }
// echo "$paragraph \n";
?>