def dist_abs(self, src, tar, gap_open=<NUM_LIT:1>, gap_ext=<NUM_LIT>, sim_func=sim_ident):
d_mat = np_zeros((len(src) + <NUM_LIT:1>, len(tar) + <NUM_LIT:1>), dtype=np_float32)<EOL>p_mat = np_zeros((len(src) + <NUM_LIT:1>, len(tar) + <NUM_LIT:1>), dtype=np_float32)<EOL>q_mat = np_zeros((len(src) + <NUM_LIT:1>, len(tar) + <NUM_LIT:1>), dtype=np_float32)<EOL>d_mat[<NUM_LIT:0>, <NUM_LIT:0>] = <NUM_LIT:0><EOL>p_mat[<NUM_LIT:0>, <NUM_LIT:0>] = float('<STR_LIT>')<EOL>q_mat[<NUM_LIT:0>, <NUM_LIT:0>] = float('<STR_LIT>')<EOL>for i in range(<NUM_LIT:1>, len(src) + <NUM_LIT:1>):<EOL><INDENT>d_mat[i, <NUM_LIT:0>] = float('<STR_LIT>')<EOL>p_mat[i, <NUM_LIT:0>] = -gap_open - gap_ext * (i - <NUM_LIT:1>)<EOL>q_mat[i, <NUM_LIT:0>] = float('<STR_LIT>')<EOL>q_mat[i, <NUM_LIT:1>] = -gap_open<EOL><DEDENT>for j in range(<NUM_LIT:1>, len(tar) + <NUM_LIT:1>):<EOL><INDENT>d_mat[<NUM_LIT:0>, j] = float('<STR_LIT>')<EOL>p_mat[<NUM_LIT:0>, j] = float('<STR_LIT>')<EOL>p_mat[<NUM_LIT:1>, j] = -gap_open<EOL>q_mat[<NUM_LIT:0>, j] = -gap_open - gap_ext * (j - <NUM_LIT:1>)<EOL><DEDENT>for i in range(<NUM_LIT:1>, len(src) + <NUM_LIT:1>):<EOL><INDENT>for j in range(<NUM_LIT:1>, len(tar) + <NUM_LIT:1>):<EOL><INDENT>sim_val = sim_func(src[i - <NUM_LIT:1>], tar[j - <NUM_LIT:1>])<EOL>d_mat[i, j] = max(<EOL>d_mat[i - <NUM_LIT:1>, j - <NUM_LIT:1>] + sim_val,<EOL>p_mat[i - <NUM_LIT:1>, j - <NUM_LIT:1>] + sim_val,<EOL>q_mat[i - <NUM_LIT:1>, j - <NUM_LIT:1>] + sim_val,<EOL>)<EOL>p_mat[i, j] = max(<EOL>d_mat[i - <NUM_LIT:1>, j] - gap_open, p_mat[i - <NUM_LIT:1>, j] - gap_ext<EOL>)<EOL>q_mat[i, j] = max(<EOL>d_mat[i, j - <NUM_LIT:1>] - gap_open, q_mat[i, j - <NUM_LIT:1>] - gap_ext<EOL>)<EOL><DEDENT><DEDENT>i, j = (n - <NUM_LIT:1> for n in d_mat.shape)<EOL>return max(d_mat[i, j], p_mat[i, j], q_mat[i, j])<EOL>
Return the Gotoh score of two strings.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison
        gap_open : float
            The cost of an open alignment gap (1 by default)
        gap_ext : float
            The cost of an alignment gap extension (0.4 by default)
        sim_func : function
            A function that returns the similarity of two characters (identity
            similarity by default)

        Returns
        -------
        float
            Gotoh score

        Examples
        --------
        >>> cmp = Gotoh()
        >>> cmp.dist_abs('cat', 'hat')
        2.0
        >>> cmp.dist_abs('Niall', 'Neil')
        1.0
        >>> round(cmp.dist_abs('aluminum', 'Catalan'), 12)
        -0.4
        >>> cmp.dist_abs('cat', 'hat')
        2.0