cvs: pear /Text_Statistics/Text Statistics.php Word.php
| From: | Arnaud Limbourg | Date: | Sun, 02 Feb 2003 10:07:40 +0000 |
| Subject: | cvs: pear /Text_Statistics/Text Statistics.php Word.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-8669@lists.php.net to get a copy of this message | ||
arnaud Sun Feb 2 05:07:40 2003 EDT
Modified files:
/pear/Text_Statistics/Text Statistics.php Word.php
Log:
* remove funky characters in PHP license header
* change phpdoc beginning /* with /** (btw, is it compulsory ?)
Index: pear/Text_Statistics/Text/Statistics.php diff -u pear/Text_Statistics/Text/Statistics.php:1.1 pear/Text_Statistics/Text/Statistics.php:1.2 --- pear/Text_Statistics/Text/Statistics.php:1.1 Sat Feb 1 19:17:09 2003 +++ pear/Text_Statistics/Text/Statistics.php Sun Feb 2 05:07:40 2003 @@ -1,24 +1,24 @@ <?php /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP version 4ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | PHP version 4 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP GroupÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.0 of the PHP license,ÊÊÊÊÊÊÊ| -// | that is bundled with this package in the file LICENSE, and isÊÊÊÊÊÊÊÊ| -// | available at through the world-wide-web atÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| -// | http://www.php.net/license/2_02.txt.ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| -// | If you did not receive a copy of the PHP license and are unable toÊÊÊ| -// | obtain it through the world-wide-web, please send a note toÊÊÊÊÊÊÊÊÊÊ| -// | license@php.net so we can mail you a copy immediately.ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | This source file is subject to version 2.0 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/2_02.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: George Schlossnagle <george@omniti.com> | // +----------------------------------------------------------------------+ // -// $Id: Statistics.php,v 1.1 2003/02/02 00:17:09 gschlossnagle Exp $ +// $Id: Statistics.php,v 1.2 2003/02/02 10:07:40 arnaud Exp $ -/* +/** * Text_Statistics calculates some basic readability metrics on a * block of text. The number of words, the number of sentences, * and the number of total syllables is counted. These statistics @@ -49,8 +49,9 @@ require_once "Text/Word.php"; -class Text_Statistics { - /* +class Text_Statistics +{ + /** * The document text. * * @var string @@ -58,7 +59,7 @@ */ var $text = ''; - /* + /** * The number of syllables in the document. * * @var number @@ -66,7 +67,7 @@ */ var $numSyllables = 0; - /* + /** * The number of words in the document. * * @var number @@ -74,35 +75,35 @@ */ var $numWords = 0; - /* + /** * The number of unique words in the document. * - * @var number + * @var number * @access public */ var $uniqWords = 0; - /* + /** * The number of sentences in the document. * - * @var number + * @var number * @access public */ var $numSentences = 0; - /* + /** * The Flesch score of the document. * - * @var number + * @var number * @access public */ var $flesch = 0; - /* + /** * Some abbreviations we should expand. THis list could/should * be much larger. * - * @var number + * @var number * @access protected */ var $_abbreviations = array('/Mr\./' => 'Misterr', @@ -111,10 +112,10 @@ '/Dr\./i' => 'Doctor', ); - /* + /** * Constructor. * - * @param string + * @param string * @access public */ function Text_Statistics($block) @@ -123,7 +124,7 @@ $this->_analyze(); } - /* + /** * Compute statistics for the document object. * * @access protected @@ -139,10 +140,10 @@ (84.6 * ($this->numSyllables/$this->numWords)); } - /* + /** * Helper function, computes statistics on a given line. * - * @param string + * @param string * @access protected */ function _analyze_line($line) @@ -164,4 +165,4 @@ $this->numSentences += count($matches[0]); } } -?> +?> \ No newline at end of file Index: pear/Text_Statistics/Text/Word.php diff -u pear/Text_Statistics/Text/Word.php:1.1 pear/Text_Statistics/Text/Word.php:1.2 --- pear/Text_Statistics/Text/Word.php:1.1 Sat Feb 1 19:17:09 2003 +++ pear/Text_Statistics/Text/Word.php Sun Feb 2 05:07:40 2003 @@ -1,24 +1,24 @@ <?php /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP version 4ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | PHP version 4 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP GroupÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.0 of the PHP license,ÊÊÊÊÊÊÊ| -// | that is bundled with this package in the file LICENSE, and isÊÊÊÊÊÊÊÊ| -// | available at through the world-wide-web atÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| -// | http://www.php.net/license/2_02.txt.ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| -// | If you did not receive a copy of the PHP license and are unable toÊÊÊ| -// | obtain it through the world-wide-web, please send a note toÊÊÊÊÊÊÊÊÊÊ| -// | license@php.net so we can mail you a copy immediately.ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | This source file is subject to version 2.0 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/2_02.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ -// | Author: George Schlossnagle <george@omniti.com> | +// | Author: George Schlossnagle <george@omniti.com> | // +----------------------------------------------------------------------+ // -// $Id: Word.php,v 1.1 2003/02/02 00:17:09 gschlossnagle Exp $ +// $Id: Word.php,v 1.2 2003/02/02 10:07:40 arnaud Exp $ -/* +/** * Text_Word calculates the number of syllables in a word, based off of * the number of contiguous vowel groupings in the word and applying * matches to detect special cases. @@ -28,30 +28,32 @@ * $word->numSyllables(); // returns 1 * * @package Text_Word - * @author George Schlossnagle <george@omniti.com> + * @author George Schlossnagle <george@omniti.com> */ - - -class Text_Word { - /* The word +class Text_Word +{ + /** + * The word * - * @var string + * @var string * @access public */ var $word; - /* The number of syllables. This is internal, the value should be + /** + * The number of syllables. This is internal, the value should be * accessed through the accessor. * - * @var number + * @var number * @access protected */ var $_numSyllables = 0; - /* The special cases of fragments which detect as 1 but should be 2 + /** + * The special cases of fragments which detect as 1 but should be 2 * syllables. * - * @var array + * @var array * @access static protected */ var $doubleSyllables = array('/\wlien/', // alien but not lien @@ -59,10 +61,11 @@ '/io/', // biography ); - /* The special cases of fragments which detect as 2 but should be 1 + /** + * The special cases of fragments which detect as 2 but should be 1 * syllables. * - * @var array + * @var array * @access static protected */ var $silentSyllables = array('/\wely$/', // absolutely but not ely @@ -70,7 +73,7 @@ '/iou/', ); - /* + /** * Constructs a word by name. * * @param string @@ -81,7 +84,7 @@ $this->word = $name; } - /* + /** * Helper function, canocalizes the word. * * @param string @@ -97,7 +100,7 @@ return $scratch; } - /* + /** * Helper function, counts syllable exceptions * * @param string @@ -124,7 +127,7 @@ return $mod; } - /* + /** * Returns the number of syllables. Caches the value in the object. * * @access public @@ -160,4 +163,4 @@ return $this->_numSyllables; } } -?> +?> \ No newline at end of file
Index: pear/Text_Statistics/Text/Statistics.php diff -u pear/Text_Statistics/Text/Statistics.php:1.1 pear/Text_Statistics/Text/Statistics.php:1.2 --- pear/Text_Statistics/Text/Statistics.php:1.1 Sat Feb 1 19:17:09 2003 +++ pear/Text_Statistics/Text/Statistics.php Sun Feb 2 05:07:40 2003 @@ -1,24 +1,24 @@ <?php /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP version 4ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | PHP version 4 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP GroupÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.0 of the PHP license,ÊÊÊÊÊÊÊ| -// | that is bundled with this package in the file LICENSE, and isÊÊÊÊÊÊÊÊ| -// | available at through the world-wide-web atÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| -// | http://www.php.net/license/2_02.txt.ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| -// | If you did not receive a copy of the PHP license and are unable toÊÊÊ| -// | obtain it through the world-wide-web, please send a note toÊÊÊÊÊÊÊÊÊÊ| -// | license@php.net so we can mail you a copy immediately.ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | This source file is subject to version 2.0 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/2_02.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: George Schlossnagle <george@omniti.com> | // +----------------------------------------------------------------------+ // -// $Id: Statistics.php,v 1.1 2003/02/02 00:17:09 gschlossnagle Exp $ +// $Id: Statistics.php,v 1.2 2003/02/02 10:07:40 arnaud Exp $ -/* +/** * Text_Statistics calculates some basic readability metrics on a * block of text. The number of words, the number of sentences, * and the number of total syllables is counted. These statistics @@ -49,8 +49,9 @@ require_once "Text/Word.php"; -class Text_Statistics { - /* +class Text_Statistics +{ + /** * The document text. * * @var string @@ -58,7 +59,7 @@ */ var $text = ''; - /* + /** * The number of syllables in the document. * * @var number @@ -66,7 +67,7 @@ */ var $numSyllables = 0; - /* + /** * The number of words in the document. * * @var number @@ -74,35 +75,35 @@ */ var $numWords = 0; - /* + /** * The number of unique words in the document. * - * @var number + * @var number * @access public */ var $uniqWords = 0; - /* + /** * The number of sentences in the document. * - * @var number + * @var number * @access public */ var $numSentences = 0; - /* + /** * The Flesch score of the document. * - * @var number + * @var number * @access public */ var $flesch = 0; - /* + /** * Some abbreviations we should expand. THis list could/should * be much larger. * - * @var number + * @var number * @access protected */ var $_abbreviations = array('/Mr\./' => 'Misterr', @@ -111,10 +112,10 @@ '/Dr\./i' => 'Doctor', ); - /* + /** * Constructor. * - * @param string + * @param string * @access public */ function Text_Statistics($block) @@ -123,7 +124,7 @@ $this->_analyze(); } - /* + /** * Compute statistics for the document object. * * @access protected @@ -139,10 +140,10 @@ (84.6 * ($this->numSyllables/$this->numWords)); } - /* + /** * Helper function, computes statistics on a given line. * - * @param string + * @param string * @access protected */ function _analyze_line($line) @@ -164,4 +165,4 @@ $this->numSentences += count($matches[0]); } } -?> +?> \ No newline at end of file Index: pear/Text_Statistics/Text/Word.php diff -u pear/Text_Statistics/Text/Word.php:1.1 pear/Text_Statistics/Text/Word.php:1.2 --- pear/Text_Statistics/Text/Word.php:1.1 Sat Feb 1 19:17:09 2003 +++ pear/Text_Statistics/Text/Word.php Sun Feb 2 05:07:40 2003 @@ -1,24 +1,24 @@ <?php /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ -// | PHP version 4ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | PHP version 4 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP GroupÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | Copyright (c) 1997-2002 The PHP Group | // +----------------------------------------------------------------------+ -// | This source file is subject to version 2.0 of the PHP license,ÊÊÊÊÊÊÊ| -// | that is bundled with this package in the file LICENSE, and isÊÊÊÊÊÊÊÊ| -// | available at through the world-wide-web atÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| -// | http://www.php.net/license/2_02.txt.ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| -// | If you did not receive a copy of the PHP license and are unable toÊÊÊ| -// | obtain it through the world-wide-web, please send a note toÊÊÊÊÊÊÊÊÊÊ| -// | license@php.net so we can mail you a copy immediately.ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ| +// | This source file is subject to version 2.0 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/2_02.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ -// | Author: George Schlossnagle <george@omniti.com> | +// | Author: George Schlossnagle <george@omniti.com> | // +----------------------------------------------------------------------+ // -// $Id: Word.php,v 1.1 2003/02/02 00:17:09 gschlossnagle Exp $ +// $Id: Word.php,v 1.2 2003/02/02 10:07:40 arnaud Exp $ -/* +/** * Text_Word calculates the number of syllables in a word, based off of * the number of contiguous vowel groupings in the word and applying * matches to detect special cases. @@ -28,30 +28,32 @@ * $word->numSyllables(); // returns 1 * * @package Text_Word - * @author George Schlossnagle <george@omniti.com> + * @author George Schlossnagle <george@omniti.com> */ - - -class Text_Word { - /* The word +class Text_Word +{ + /** + * The word * - * @var string + * @var string * @access public */ var $word; - /* The number of syllables. This is internal, the value should be + /** + * The number of syllables. This is internal, the value should be * accessed through the accessor. * - * @var number + * @var number * @access protected */ var $_numSyllables = 0; - /* The special cases of fragments which detect as 1 but should be 2 + /** + * The special cases of fragments which detect as 1 but should be 2 * syllables. * - * @var array + * @var array * @access static protected */ var $doubleSyllables = array('/\wlien/', // alien but not lien @@ -59,10 +61,11 @@ '/io/', // biography ); - /* The special cases of fragments which detect as 2 but should be 1 + /** + * The special cases of fragments which detect as 2 but should be 1 * syllables. * - * @var array + * @var array * @access static protected */ var $silentSyllables = array('/\wely$/', // absolutely but not ely @@ -70,7 +73,7 @@ '/iou/', ); - /* + /** * Constructs a word by name. * * @param string @@ -81,7 +84,7 @@ $this->word = $name; } - /* + /** * Helper function, canocalizes the word. * * @param string @@ -97,7 +100,7 @@ return $scratch; } - /* + /** * Helper function, counts syllable exceptions * * @param string @@ -124,7 +127,7 @@ return $mod; } - /* + /** * Returns the number of syllables. Caches the value in the object. * * @access public @@ -160,4 +163,4 @@ return $this->_numSyllables; } } -?> +?> \ No newline at end of file