diff --git a/tests/TextStatisticsCMULexTest.php b/tests/TextStatisticsCMULexTest.php index 17fe728..385aea4 100644 --- a/tests/TextStatisticsCMULexTest.php +++ b/tests/TextStatisticsCMULexTest.php @@ -1,6 +1,6 @@ assertEquals(7.2, $this->TextStatistics->smog_index($this->strText)); + $this->assertEquals(10.3, $this->TextStatistics->smog_index($this->strText)); } /* Test Automated Readability Index diff --git a/tests/TextStatisticsMaths.php b/tests/TextStatisticsMaths.php index 57f8381..ceec2f8 100644 --- a/tests/TextStatisticsMaths.php +++ b/tests/TextStatisticsMaths.php @@ -1,6 +1,6 @@ assertSame(3.0, DaveChild\TextStatistics\Maths::bcCalc(10, 'mod', 7, true, 1)); $this->assertSame(3.0, DaveChild\TextStatistics\Maths::bcCalc(10, 'modulus', 7, true, 1)); // Modulus can only be an integer and is rounded before calculation - $this->assertSame(0.0, DaveChild\TextStatistics\Maths::bcCalc(10, '%', 5.55, true, 1)); - $this->assertSame(0.0, DaveChild\TextStatistics\Maths::bcCalc(10, 'mod', 5.55, true, 1)); - $this->assertSame(0.0, DaveChild\TextStatistics\Maths::bcCalc(10, 'modulus', 5.55, true, 1)); - $this->assertSame(3.0, DaveChild\TextStatistics\Maths::bcCalc(10, '%', 7.55, true, 1)); - $this->assertSame(3.0, DaveChild\TextStatistics\Maths::bcCalc(10, 'mod', 7.55, true, 1)); - $this->assertSame(3.0, DaveChild\TextStatistics\Maths::bcCalc(10, 'modulus', 7.55, true, 1)); + $this->assertSame(4.0, DaveChild\TextStatistics\Maths::bcCalc(10, '%', 5.55, true, 1)); + $this->assertSame(4.0, DaveChild\TextStatistics\Maths::bcCalc(10, 'mod', 5.55, true, 1)); + $this->assertSame(4.0, DaveChild\TextStatistics\Maths::bcCalc(10, 'modulus', 5.55, true, 1)); + $this->assertSame(2.0, DaveChild\TextStatistics\Maths::bcCalc(10, '%', 7.55, true, 1)); + $this->assertSame(2.0, DaveChild\TextStatistics\Maths::bcCalc(10, 'mod', 7.55, true, 1)); + $this->assertSame(2.0, DaveChild\TextStatistics\Maths::bcCalc(10, 'modulus', 7.55, true, 1)); $this->assertSame(1, DaveChild\TextStatistics\Maths::bcCalc(10, '=', 5, true, 1)); $this->assertSame(1, DaveChild\TextStatistics\Maths::bcCalc(10, 'comp', 5, true, 1)); @@ -139,12 +139,12 @@ public function testCalc() $this->assertSame(3, DaveChild\TextStatistics\Maths::bcCalc(10, 'mod', 7)); $this->assertSame(3, DaveChild\TextStatistics\Maths::bcCalc(10, 'modulus', 7)); // Modulus can only be an integer and is rounded before calculation - $this->assertSame(0, DaveChild\TextStatistics\Maths::bcCalc(10, '%', 5.55)); - $this->assertSame(0, DaveChild\TextStatistics\Maths::bcCalc(10, 'mod', 5.55)); - $this->assertSame(0, DaveChild\TextStatistics\Maths::bcCalc(10, 'modulus', 5.55)); - $this->assertSame(3, DaveChild\TextStatistics\Maths::bcCalc(10, '%', 7.55)); - $this->assertSame(3, DaveChild\TextStatistics\Maths::bcCalc(10, 'mod', 7.55)); - $this->assertSame(3, DaveChild\TextStatistics\Maths::bcCalc(10, 'modulus', 7.55)); + $this->assertSame(4, DaveChild\TextStatistics\Maths::bcCalc(10, '%', 5.55)); + $this->assertSame(4, DaveChild\TextStatistics\Maths::bcCalc(10, 'mod', 5.55)); + $this->assertSame(4, DaveChild\TextStatistics\Maths::bcCalc(10, 'modulus', 5.55)); + $this->assertSame(2, DaveChild\TextStatistics\Maths::bcCalc(10, '%', 7.55)); + $this->assertSame(2, DaveChild\TextStatistics\Maths::bcCalc(10, 'mod', 7.55)); + $this->assertSame(2, DaveChild\TextStatistics\Maths::bcCalc(10, 'modulus', 7.55)); $this->assertSame(1, DaveChild\TextStatistics\Maths::bcCalc(10, '=', 5)); $this->assertSame(1, DaveChild\TextStatistics\Maths::bcCalc(10, 'comp', 5)); diff --git a/tests/TextStatisticsMelvilleMobyDickTest.php b/tests/TextStatisticsMelvilleMobyDickTest.php index cfc3f6c..5c43be7 100644 --- a/tests/TextStatisticsMelvilleMobyDickTest.php +++ b/tests/TextStatisticsMelvilleMobyDickTest.php @@ -1,6 +1,6 @@ assertEquals(9.9, $this->TextStatistics->smog_index($this->strText)); + $this->assertEquals(13.0, $this->TextStatistics->smog_index($this->strText)); } /* Test Automated Readability Index @@ -334,4 +334,4 @@ public function testAutomatedReadabilityIndex() { $this->assertEquals(11.8, $this->TextStatistics->automated_readability_index($this->strText)); } - } +} diff --git a/tests/TextStatisticsPluralise.php b/tests/TextStatisticsPluralise.php index a66387f..ef659bc 100644 --- a/tests/TextStatisticsPluralise.php +++ b/tests/TextStatisticsPluralise.php @@ -1,6 +1,6 @@ assertEquals(1.8, $this->TextStatistics->smog_index('This. Is. A. Nice. Set. Of. Small. Words. Of. One. Part. Each.')); // Should be 1.8 for any text with no words of 3+ syllables - $this->assertEquals(1.8, $this->TextStatistics->smog_index('The quick brown fox jumps over the lazy dog.')); - $this->assertEquals(1.8, $this->TextStatistics->smog_index('The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.')); - $this->assertEquals(1.8, $this->TextStatistics->smog_index("The quick brown fox jumps over the lazy dog. \n\n The quick brown fox jumps over the lazy dog.")); - $this->assertEquals(1.8, $this->TextStatistics->smog_index('The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog')); - $this->assertEquals(10.1, $this->TextStatistics->smog_index('Now it is time for a more complicated sentence, including several longer words.')); + $this->assertEquals(3.3, $this->TextStatistics->smog_index('This. Is. A. Nice. Set. Of. Small. Words. Of. One. Part. Each.')); // Should be 1.8 for any text with no words of 3+ syllables + $this->assertEquals(3.3, $this->TextStatistics->smog_index('The quick brown fox jumps over the lazy dog.')); + $this->assertEquals(3.3, $this->TextStatistics->smog_index('The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.')); + $this->assertEquals(3.3, $this->TextStatistics->smog_index("The quick brown fox jumps over the lazy dog. \n\n The quick brown fox jumps over the lazy dog.")); + $this->assertEquals(3.3, $this->TextStatistics->smog_index('The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog')); + $this->assertEquals(13.2, $this->TextStatistics->smog_index('Now it is time for a more complicated sentence, including several longer words.')); } public function testAutomatedReadabilityIndex()