private double leetEntropy()
    {
        if (!isLeet())
        {
            return 0d;
        }

        int possibilities = 0;
        for (Character[] sub : leetSubstitution)
        {
            char original = sub[0];
            char newChar = sub[1];
            int substitutionCount = 0;
            int unSubstitutionCount = 0;
            for (char c : getToken().toCharArray())
            {
                if (c == newChar)
                {
                    substitutionCount++;
                }
                if (c == original)
                {
                    unSubstitutionCount++;
                }
            }
            int totalSub = substitutionCount + unSubstitutionCount;
            int minSub = Math.min(substitutionCount, unSubstitutionCount);
            for (int i = 0; i <= minSub; i++)
            {
                possibilities += nCk(totalSub, i);
            }
        }

        return Math.max(1, log2(possibilities)); // 1 bit of entropy (instead of 0)
        // for single-letter substitution
        // like 4pple -> apple
    }
private double leetEntropy ( ) { if ( ! isLeet ( ) ) { return 0d ; } int possibilities = 0 ; for ( Character [ ] sub : leetSubstitution ) { char original = sub [ 0 ] ; char newChar = sub [ 1 ] ; int substitutionCount = 0 ; int unSubstitutionCount = 0 ; for ( char c : getToken ( ) . toCharArray ( ) ) { if ( c == newChar ) { substitutionCount ++ ; } if ( c == original ) { unSubstitutionCount ++ ; } } int totalSub = substitutionCount + unSubstitutionCount ; int minSub = Math . min ( substitutionCount , unSubstitutionCount ) ; for ( int i = 0 ; i <= minSub ; i ++ ) { possibilities += nCk ( totalSub , i ) ; } } return Math . max ( 1 , log2 ( possibilities ) ) ; }
@return the additional entropy provided by leet formatting