public function applyTransformation(TransformationInterface $transform)
    {
        $null_filter = function ($token) {
            return $token!==null;
        };

        $this->word = $transform->transform($this->word);
        // array_values for re-indexing
        $this->before = array_values(
            array_filter(
                array_map(
                    array($transform,"transform"),
                    $this->before
                ),
                $null_filter
            )
        );
        $this->after = array_values(
            array_filter(
                array_map(
                    array($transform,"transform"),
                    $this->after
                ),
                $null_filter
            )
        );
    }
public function applyTransformation(TransformationInterface $transform)
    {
        $null_filter = function ($token) {
            return $token!==null;
        };

        $this->word = $transform->transform($this->word);
        // array_values for re-indexing
        $this->before = array_values(
            array_filter(
                array_map(
                    array($transform,"transform"),
                    $this->before
                ),
                $null_filter
            )
        );
        $this->after = array_values(
            array_filter(
                array_map(
                    array($transform,"transform"),
                    $this->after
                ),
                $null_filter
            )
        );
    }
public function applyTransformation ( TransformationInterface $ transform ) { $ null_filter = function ( $ token ) { return $ token !== null ; } ; $ this -> word = $ transform -> transform ( $ this -> word ) ; // array_values for re-indexing $ this -> before = array_values ( array_filter ( array_map ( array ( $ transform , "transform" ) , $ this -> before ) , $ null_filter ) ) ; $ this -> after = array_values ( array_filter ( array_map ( array ( $ transform , "transform" ) , $ this -> after ) , $ null_filter ) ) ; }
Apply the transformation to the token and the surrounding context.
Filter out the null tokens from the context. If the word is transformed
to null it is for the feature factory to decide what to do.

@param TransformationInterface $transform The transformation to be applied
Apply the transformation to the token and the surrounding context . Filter out the null tokens from the context . If the word is transformed to null it is for the feature factory to decide what to do .