Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface::tokenize PHP Méthode

tokenize() public méthode

Split document into tokens
public tokenize ( string $document ) : array
$document string The document to split
Résultat array An array of tokens
    public function tokenize($document);

Usage Example

 public function __invoke($data)
 {
     foreach ($data as $category => $documents) {
         foreach ($documents as $index => $document) {
             if ($this->documentNormalizer) {
                 $document = $this->documentNormalizer->normalize($document);
             }
             $tokens = $this->tokenizer->tokenize($document);
             if ($this->tokenNormalizer) {
                 $tokens = $this->tokenNormalizer->normalize($tokens);
             }
             $data[$category][$index] = $tokens;
         }
     }
     return $data;
 }
All Usage Examples Of Camspiers\StatisticalClassifier\Tokenizer\TokenizerInterface::tokenize
TokenizerInterface