Download the PHP package org_heigl/textstatistics without Composer
On this page you can find all versions of the php package org_heigl/textstatistics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download org_heigl/textstatistics
More information about org_heigl/textstatistics
Files in org_heigl/textstatistics
Package textstatistics
Short Description Get statistics from a given text
License MIT
Informations about the package textstatistics
Text-Statistics
Calculate text-statistics including Sylables, Flesch-Reading-Ease (english and german) and such things.
Why
The one other implementation davechild/textstatistics sadly only implements statistics for english texts. That sadly didn't work for texts with f.e. german umlauts. So I decided to implement some of the algorithms again using work I already did for a hyphenator.
That's why f.e. the syllable-calculation differs.
Installation
TextStatistics is best installed using composer
Usage
The different Calculators all implement a common and therefore all provide a -Method that expects a -Object containing the Text to be calculated.
Currently these Statistics are avalable:
- Average Sentence Length
- Average Syllables per word
- Character-Count (including Whitespace)
- Character-Count (excluding whitespace)
- Flesch-Kincaid Grade Level
- Flesch-Reading-Ease for English texts
- Flesch-Reading-Ease for German texts
- Flesch-Reading-Ease School-Grade measurement
- Sentence-Count
- Max Syllables in Sentence
- Max Words in Sentence
- Syllable-Count
- Wiener Sachtext-Formel 1, 2, 3 and 4
- Word-Count
- Max Syllables in Word
- Number of words with minimum N characters
- Percentage of Words with minimum N characters
- Number of words with minimum N syllables
- Percentage of words with minimum N syllables
- Number of words with only N syllables
- Percentage of words with only N syllables
There are Factory-Methods for each statistic available, so getting one of the statistics requires the following line of code:
You can also add multiple Calculators to the TextStatisticsGenerator and retrieve multiple Statistics in one go like this: