Skip to content

Commit 43d993d

Browse files
committed
Use DaveChild's Text-Statistics package for syllables
1 parent 75f7165 commit 43d993d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"require": {
66
"php": "^7.0",
77
"rapidwebltd/rw-file-cache": "^1.2",
8-
"divineomega/is_offensive": "^1.0"
8+
"divineomega/is_offensive": "^1.0",
9+
"davechild/textstatistics": "^1.0"
910
},
1011
"require-dev": {
1112
"phpunit/phpunit": "^5.7",

src/Word.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use rapidweb\RWFileCache\RWFileCache;
55
use Snipe\BanBuilder\CensorWords;
6+
use DaveChild\TextStatistics\Syllables;
67

78
class Word {
89

@@ -89,7 +90,7 @@ private function wordInfo()
8990

9091
public function syllables()
9192
{
92-
return $this->wordInfo()->syllables;
93+
return Syllables::syllableCount($this->word);
9394
}
9495

9596
public function offensive()

0 commit comments

Comments
 (0)