original_string: public function getMaximalDistance()
      {
          $oneSize = mb_strlen($this->compOne, 'UTF-8');
          $twoSize = mb_strlen($this->compTwo, 'UTF-8');
  
          // Is substitution cheaper that delete + insert?
          $subCost = min($this->subCost, $this->delCost + $this->insCost);
  
          // Get common size
          $minSize = min($oneSize, $twoSize);
          $maxSize = max($oneSize, $twoSize);
          $extraSize = $maxSize - $minSize;
  
          // On common size perform substitution / delete + insert, what is cheaper
          $maxCost = $subCost * $minSize;
  
          // On resulting do insert/delete
          if ($oneSize > $twoSize) {
              // Delete extra characters
              $maxCost += $extraSize * $this->delCost;
          } else {
              // Insert extra characters
              $maxCost += $extraSize * $this->insCost;
          }
  
          return $maxCost;
      }
code: public function getMaximalDistance()
      {
          $oneSize = mb_strlen($this->compOne, 'UTF-8');
          $twoSize = mb_strlen($this->compTwo, 'UTF-8');
  
          // Is substitution cheaper that delete + insert?
          $subCost = min($this->subCost, $this->delCost + $this->insCost);
  
          // Get common size
          $minSize = min($oneSize, $twoSize);
          $maxSize = max($oneSize, $twoSize);
          $extraSize = $maxSize - $minSize;
  
          // On common size perform substitution / delete + insert, what is cheaper
          $maxCost = $subCost * $minSize;
  
          // On resulting do insert/delete
          if ($oneSize > $twoSize) {
              // Delete extra characters
              $maxCost += $extraSize * $this->delCost;
          } else {
              // Insert extra characters
              $maxCost += $extraSize * $this->insCost;
          }
  
          return $maxCost;
      }
code_tokens: public function getMaximalDistance ( ) { $ oneSize = mb_strlen ( $ this -> compOne , 'UTF-8' ) ; $ twoSize = mb_strlen ( $ this -> compTwo , 'UTF-8' ) ; // Is substitution cheaper that delete + insert? $ subCost = min ( $ this -> subCost , $ this -> delCost + $ this -> insCost ) ; // Get common size $ minSize = min ( $ oneSize , $ twoSize ) ; $ maxSize = max ( $ oneSize , $ twoSize ) ; $ extraSize = $ maxSize - $ minSize ; // On common size perform substitution / delete + insert, what is cheaper $ maxCost = $ subCost * $ minSize ; // On resulting do insert/delete if ( $ oneSize > $ twoSize ) { // Delete extra characters $ maxCost += $ extraSize * $ this -> delCost ; } else { // Insert extra characters $ maxCost += $ extraSize * $ this -> insCost ; } return $ maxCost ; }
docstring: Returns maximal possible edit Damerau Levenshtein distance between texts.
  
  On common substring of same length perform substitution / insert + delete
  (depends on what is cheaper), then on extra characters perform insertion / deletion
  
  @return int
docstring_tokens: Returns maximal possible edit Damerau Levenshtein distance between texts .