public function getPasswordStrength( $password ) {
        $topology = $this->strToTopology( $password );
        $str = $topology['str'];
        $upper = $topology['u'];
        $lower = $topology['l'];
        $digit = $topology['d'];
        $special = $topology['s'];
        $len = strlen( $str );

        $pairs = unserialize( file_get_contents( __DIR__ . '/phoneme.php' ) );
        
        //start at 0
        $value = 0;
        
        //length of password adds 1 to the score
        $value += $len * 0.5;
        
        //bonus for a mix of upper, digit, and special
        $value += $upper*0.5 + $digit*0.5 + $special / $len * 50;

        //===============================//
        //bonus for each none lowercase in the center
        for( $i = 1; $i < $len - 1; $i++ ) {
            //the position goes 1 2 3 2 1, not 1 2 3 4 5
            $pos = ($i > $len / 2) ? $len - $i : $i;
            
            if( $str[$i] != 'l' ) {
                $value += $pos / $len * 10; //add bonus for distance from edge
            }    
        }
        
        //===============================//
        //consecutive characters are bad
        $prev = null;
        $prevTopo = null;
        
        for( $i = 0; $i < $len; $i++ ) {
            if( $password[$i] == $prev ) {
                $value -= 1.0;
            }

            if( $str[$i] !== $prevTopo ) {
                $value -= 1.0;
            }
            
            $prevTopo = $str[$i];
            $prev = $password[$i];
        }
        
        //===============================//
        //character set
        $set = array();
        
        for( $i = 0; $i < $len; $i++ ) {
            $set[$password[$i]] = null;
        }
        
        $value += count( $set );
        
        //===============================//
        //check pairs
        $pairTotal = 0;
        
        foreach( $pairs as $phoneme=>$c ) {
            if( strpos( $password, $phoneme ) !== false )
                $pairTotal += $c * 100;
        }
        
        $value -= $pairTotal;
        
        //===============================//
        //good mix of ULDS?
        $value -= 10*(abs(0.25 - $upper/$len) + abs(0.25 - $lower/$len) + abs(0.25 - $digit/$len) + abs(0.25 - $special/$len));
        return $value;
    }