5 * @subpackage plugins
\r
10 * Smarty count_sentences modifier plugin
\r
12 * Type: modifier<br>
\r
13 * Name: count_sentences
\r
14 * Purpose: count the number of sentences in a text
\r
15 * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
\r
16 * count_sentences (Smarty online manual)
\r
20 function smarty_modifier_count_sentences($string)
\r
22 // find periods with a word before but not after.
\r
23 return preg_match_all('/[^\s]\.(?!\w)/', $string, $match);
\r
26 /* vim: set expandtab: */
\r