DaveChild / Text-Statistics

Generate information about text including syllable counts and Flesch-Kincaid, Gunning-Fog, Coleman-Liau, SMOG and Automated Readability scores.
https://readable.com/
BSD 2-Clause "Simplified" License
446 stars 107 forks source link

incorrectly considered SMOG #33

Closed AndrewTemnokhud closed 8 years ago

AndrewTemnokhud commented 8 years ago

Hellow. Incorrectly considered SMOG. Сheck formula whith https://en.wikipedia.org/wiki/SMOG.

AndrewTemnokhud commented 8 years ago

$score =Maths::bcCalc( Maths::bcCalc( 1.043, '', Maths::bcCalc( Maths::bcCalc( Syllables::wordsWithThreeSyllables($strText, true, $this->strEncoding), '', Maths::bcCalc( 30, '/', Text::sentenceCount($strText, $this->strEncoding) ) ), 'sqrt', 0 ) ), '+', 3.129 );

DaveChild commented 8 years ago

That looks spot on to me. What do you think is incorrect?

AndrewTemnokhud commented 8 years ago

image Your code (see 3.1291):

    $score = Maths::bcCalc(
        1.043,
        '*',
        Maths::bcCalc(
            Maths::bcCalc(
                Maths::bcCalc(
                    Syllables::wordsWithThreeSyllables($strText, true, $this->strEncoding),
                    '*',
                    Maths::bcCalc(
                        30,
                        '/',
                        Text::sentenceCount($strText, $this->strEncoding)
                    )
                ),
                '+',
                3.1291
            ),
            'sqrt',
            0
        )
    );