[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/bayesian/ -> tokenizer.class.php (source)

   1  <?php
   2  
   3      
   4  
   5      /**
   6       * \ingroup Bayesian
   7       * 
   8       * Class that defines the interface for classes wishing to implement a tokenizer
   9       */
  10      class Tokenizer  
  11      {
  12  
  13          /**
  14           * constructor, takes no parameters
  15           */
  16      	function Tokenizer()
  17          {
  18              
  19          }
  20  
  21          /**
  22           * given an input text, possibly containing HTML tags, it will split it into
  23           * all the different words that make it up.
  24           *
  25           * @param text The text to split
  26           * @param unique Whether the return array should contain unique items or if the same
  27           * word is allowed more than once.
  28           * @return An array where each item is a word from the text
  29           */
  30          function tokenize($text, $unique = false)
  31          {
  32              throw(new Exception("Tokenizer::tokenize: This method must be implemented by child classes."));
  33              die();
  34          }
  35      }
  36  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics