You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This uses the Polyglot multilingual NLP library to return entities and a sentiment score for given text.Ensure the models for the required languages are downloaded for Polyglot.
85
85
86
86
```php
@@ -112,7 +112,7 @@ $polyglot->getPersons(); // Array of people
112
112
113
113
$polyglot->getEntities();
114
114
/*
115
-
Returns combined array of all entities
115
+
Returns flat array of all entities
116
116
Array
117
117
(
118
118
[0] => Ben
@@ -157,7 +157,7 @@ Array
157
157
*/
158
158
```
159
159
160
-
English is used by default. To use another languageensure Spacy language model is downloaded and add the language as the second parameter
160
+
English is used by default. To use another language, ensure the Spacy language model is downloaded and add the language as the second parameter
Copy file name to clipboardExpand all lines: tests/Unit/SummarizerTest.php
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -37,4 +37,40 @@ public function get_summary()
37
37
38
38
$this->assertNotEmpty( $summary );
39
39
}
40
+
41
+
/** @test */
42
+
publicfunctionget_summary_word_count()
43
+
{
44
+
$nlp = new \Web64\Nlp\NlpClient( $this->nlpserver_config['hosts'], $this->nlpserver_config['debug'] );
45
+
46
+
$text = "Portland stone is a limestone from the Tithonian stage of the Jurassic period quarried on the Isle of Portland, Dorset. The quarries consist of beds of white-grey limestone
47
+
separated by chert beds. It has been used extensively as a building stone throughout the British Isles, notably in major public buildings in London such as St Paul's Cathedral and
48
+
Buckingham Palace. Portland stone is also exported to many countries—Portland stone is used in the United Nations headquarters building in New York City, for example.
49
+
Portland stone formed in a marine environment, on the floor of a shallow, warm, sub-tropical sea probably near land (as evidenced by fossilized driftwood, which is not uncommon).
50
+
When seawater is warmed by the sun, its capacity to hold dissolved gas is reduced, consequently dissolved carbon dioxide (CO2) is released into the atmosphere as a gas.
51
+
Calcium and bicarbonate ions within the water are then able to combine, to form calcium carbonate (CaCO3) as a precipitate.
52
+
The process of lime scale build up in a kettle in hard water areas is similar. Calcium carbonate is the principal constituent of most limestones.
53
+
Billions of minute crystals of precipitated calcium carbonate (called calcite) accumulated forming lime mud (called micrite) which covered the sea floor.
54
+
Small particles of sand or organic detritus, such as shell fragments, formed a nucleus, which became coated with layers of calcite as they were rolled around in the muddy micrite.
55
+
56
+
The calcite gradually accumulated (by accretion) around the fragments of shell in concentric layers, forming small balls (of less than 0.5 mm diameter).
57
+
This process is similar to the way in which a snowball grows in size as it is rolled around in the snow. Over time, countless billions of these balls, known as \"ooids\" or \"ooliths\"
58
+
(from the Greek for \"egg-shaped\" or \"egg-stone\"), became partially cemented together (or lithified) by more calcite, to form the oolitic limestone we now call Portland stone.
59
+
Fortunately, the degree of cementation in Portland stone is such that the stone is sufficiently well cemented to allow it to resist weathering, but not so well cemented that it can't be
60
+
readily worked (cut and carved) by masons. This is one of the reasons why Portland stone is so favoured as a monumental and architectural stone.
61
+
Dr Geoff Townson conducted three years doctoral research on the Portlandian, being the first to describe the patch-reef facies and Dorset-wide sedimentation details .
62
+
Dr Ian West of the School of Ocean and Earth Sciences at Southampton University completed a detailed geological survey of Withies Croft Quarry before the Portland Beds were quarried by
0 commit comments