def sim(self, src, tar):
if src == tar:<EOL><INDENT>return <NUM_LIT:1.0><EOL><DEDENT>if not src or not tar:<EOL><INDENT>return <NUM_LIT:0.0><EOL><DEDENT>min_word, max_word = (src, tar) if len(src) < len(tar) else (tar, src)<EOL>min_len = len(min_word)<EOL>for i in range(min_len, <NUM_LIT:0>, -<NUM_LIT:1>):<EOL><INDENT>if min_word[-i:] == max_word[-i:]:<EOL><INDENT>return i / min_len<EOL><DEDENT><DEDENT>return <NUM_LIT:0.0><EOL>
Return the suffix similarity of two strings.

        Suffix similarity is the ratio of the length of the shorter term that
        exactly matches the longer term to the length of the shorter term,
        beginning at the end of both terms.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            Suffix similarity

        Examples
        --------
        >>> cmp = Suffix()
        >>> cmp.sim('cat', 'hat')
        0.6666666666666666
        >>> cmp.sim('Niall', 'Neil')
        0.25
        >>> cmp.sim('aluminum', 'Catalan')
        0.0
        >>> cmp.sim('ATCG', 'TAGC')
        0.0