src/snac/server/identityReconciliation/stages/OriginalLengthDifference.php
/**
     * Run function
     *
     * Calculates the difference in string length between the search identity's original string and the original string of each identites in the list passed.  To calculate the score, we use the following algorithm:
     *
     * `result = -1 * ln( abs( len(search) - len(other) ) )`
     *
     * @param \snac\data\Constellation $search The constellation to be evaluated.
     * @param \snac\data\ReconciliationResult[] $list A list of results to evaluate against.  This
     * may be null.
     * @return array An array of results.  On error, it must at least
     * return an empty array. It may not return null.
     *
     */
Run function
Calculates the difference in string length between the search identity's original string and the original string of each identites in the list passed.  To calculate the score, we use the following algorithm.

`result = -1 * ln( abs( len(search) - len(other) ) )`

@param \snac\data\Constellation $search The constellation to be evaluated.
@param \snac\data\ReconciliationResult[] $list A list of results to evaluate against.  This
may be null.
@return array An array of results.  On error, it must at least
return an empty array. It may not return null.
Run function Calculates the difference in string length between the search identity ' s original string and the original string of each identites in the list passed . To calculate the score we use the following algorithm . ` result = - 1 * ln ( abs ( len ( search ) - len ( other ) ) ) ` @param \ snac \ data \ Constellation $search The constellation to be evaluated . @param \ snac \ data \ ReconciliationResult [] $list A list of results to evaluate against . This may be null . @return array An array of results . On error it must at least return an empty array . It may not return null .
public function run($search, $list) {
        if ($list == null)
            return array();
        $results = array();
        foreach ($list as $res) {
            $diff = strlen($search->getPreferredNameEntry()->getOriginal()) - strlen($res->getIdentity()->getPreferredNameEntry()->getOriginal());
            $diff = abs($diff);
            $resultDiff = 0;
            if ($diff > 0)
                $resultDiff = -4 * log($diff);
            $result = new \snac\data\ReconciliationResult();
            $result->setIdentity($res->getIdentity());
            $result->setStrength($resultDiff);
            array_push($results, $result);
        }
        return $results;
    }
public function run ( $ search , $ list ) { if ( $ list == null ) return array ( ) ; $ results = array ( ) ; foreach ( $ list as $ res ) { $ diff = strlen ( $ search -> getPreferredNameEntry ( ) -> getOriginal ( ) ) - strlen ( $ res -> getIdentity ( ) -> getPreferredNameEntry ( ) -> getOriginal ( ) ) ; $ diff = abs ( $ diff ) ; $ resultDiff = 0 ; if ( $ diff > 0 ) $ resultDiff = - 4 * log ( $ diff ) ; $ result = new \ snac \ data \ ReconciliationResult ( ) ; $ result -> setIdentity ( $ res -> getIdentity ( ) ) ; $ result -> setStrength ( $ resultDiff ) ; array_push ( $ results , $ result ) ; } return $ results ; }
Run function
 Calculates the difference in string length between the search identity's original string and the original string of each identites in the list passed.
Run function Calculates the difference in string length between the search identity ' s original string and the original string of each identites in the list passed .
// Error case, list is null // Compute the strength value // Save the result