Here's the test case:
---
public function testWordCountWithQuotes() {
$textStats = new TextStatistics();
$text = "\"There should be seven words,\" said Joe";
$expected = 7;
$actual = $textStats->word_count($text); // value is 8
$this->assertEqual($actual, $expected);
}
---
Here's a possible fix:
In the clean_text(), replace:
---
$strText = preg_replace('/[,:;()-]/', ' ', $strText); // Replace commans,
hyphens etc (count them as spaces)
---
with:
---
$strText = preg_replace('/[",:;()-]/', ' ', $strText); // Replace double
quotes, commans, hyphens etc (count them as spaces)
---
Original issue reported on code.google.com by james...@gmail.com on 2 Jun 2009 at 2:28
Original issue reported on code.google.com by
james...@gmail.com
on 2 Jun 2009 at 2:28