public function visit(ContextInterface $context)
 {
     $result = $this->remove($context->getCurrentWord());
     if ($result != $context->getCurrentWord()) {
         $removedPart = preg_replace("/{$result}/", '', $context->getCurrentWord(), 1);
         $removal = new Removal($this, $context->getCurrentWord(), $result, $removedPart, 'DP');
         $context->addRemoval($removal);
         $context->setCurrentWord($result);
     }
 }
 public function visit(ContextInterface $context)
 {
     $result = null;
     foreach ($this->disambiguators as $disambiguator) {
         $result = $disambiguator->disambiguate($context->getCurrentWord());
         if ($context->getDictionary()->contains($result)) {
             break;
         }
     }
     if ($result === null) {
         return;
     }
     $removedPart = preg_replace("/{$result}/", '', $context->getCurrentWord(), 1);
     $removal = new Removal($this, $context->getCurrentWord(), $result, $removedPart, 'DP');
     $context->addRemoval($removal);
     $context->setCurrentWord($result);
 }
 public function visit(ContextInterface $context)
 {
     if ($this->isShortWord($context->getCurrentWord())) {
         $context->stopProcess();
     }
 }