Exemplo n.º 1
0
 /**
  * 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
  */
 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));
 }
Exemplo n.º 2
0
 public function applyTransformation(TransformationInterface $transform)
 {
     $this->data = $transform->transform($this->data);
 }
Exemplo n.º 3
0
 public function applyTransformation(TransformationInterface $transform)
 {
     $this->x = $transform->transform($this->x);
     $this->y = $transform->transform($this->y);
 }