PHP Класс DaveChild\TextStatistics\Syllables

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$arrAddSyllables These syllables would be counted as one but should be two
$arrAffix Single syllable prefixes and suffixes
$arrDoubleAffix Double syllable prefixes and suffixes
$arrProblemWords - Portmanteaus
$arrSubSyllables These syllables would be counted as two but should be one
$arrTripleAffix Triple syllable prefixes and suffixes

Открытые методы

Метод Описание
averageSyllablesPerWord ( string $strText, string $strEncoding = '' ) : integer | float Returns average syllables per word for text.
percentageWordsWithThreeSyllables ( string $strText, boolean $blnCountProperNouns = true, $strEncoding = '' ) : integer | float Returns the percentage of words with more than three syllables
syllableCount ( string $strWord, string $strEncoding = '' ) : integer Returns the number of syllables in the word.
totalSyllables ( string $strText, string $strEncoding = '' ) : integer Returns total syllable count for text.
wordsWithThreeSyllables ( string $strText, boolean $blnCountProperNouns = true, string $strEncoding = '' ) : integer Returns the number of words with more than three syllables

Описание методов

averageSyllablesPerWord() публичный статический Метод

Returns average syllables per word for text.
public static averageSyllablesPerWord ( string $strText, string $strEncoding = '' ) : integer | float
$strText string Text to be measured
$strEncoding string Encoding of text
Результат integer | float

percentageWordsWithThreeSyllables() публичный статический Метод

Returns the percentage of words with more than three syllables
public static percentageWordsWithThreeSyllables ( string $strText, boolean $blnCountProperNouns = true, $strEncoding = '' ) : integer | float
$strText string Text to be measured
$blnCountProperNouns boolean Boolean - should proper nouns be included in words count
Результат integer | float

syllableCount() публичный статический Метод

Based in part on Greg Fast's Perl module Lingua::EN::Syllables
public static syllableCount ( string $strWord, string $strEncoding = '' ) : integer
$strWord string Word to be measured
$strEncoding string Encoding of text
Результат integer

totalSyllables() публичный статический Метод

Returns total syllable count for text.
public static totalSyllables ( string $strText, string $strEncoding = '' ) : integer
$strText string Text to be measured
$strEncoding string Encoding of text
Результат integer

wordsWithThreeSyllables() публичный статический Метод

Returns the number of words with more than three syllables
public static wordsWithThreeSyllables ( string $strText, boolean $blnCountProperNouns = true, string $strEncoding = '' ) : integer
$strText string Text to be measured
$blnCountProperNouns boolean Boolean - should proper nouns be included in words count
$strEncoding string Encoding of text
Результат integer

Описание свойств

$arrAddSyllables публичное статическое свойство

These syllables would be counted as one but should be two
public static $arrAddSyllables

$arrAffix публичное статическое свойство

Single syllable prefixes and suffixes
public static $arrAffix

$arrDoubleAffix публичное статическое свойство

Double syllable prefixes and suffixes
public static $arrDoubleAffix

$arrProblemWords публичное статическое свойство

- Portmanteaus
public static $arrProblemWords

$arrSubSyllables публичное статическое свойство

These syllables would be counted as two but should be one
public static $arrSubSyllables

$arrTripleAffix публичное статическое свойство

Triple syllable prefixes and suffixes
public static $arrTripleAffix