Code Duplication    Length = 11-11 lines in 3 locations

abydos/distance/_synoname.py 3 locations

@@ 504-514 (lines=11) @@
501
                and levenshtein(src_fn, tar_fn, cost=(99, 99, 1, 99)) == 1
502
            ):
503
                return _fmt_retval(self.match_type_dict['substitution'])
504
        if tests & self.test_dict['transposition']:
505
            if fn_equal and (
506
                levenshtein(src_ln, tar_ln, mode='osa', cost=(99, 99, 99, 1))
507
                == 1
508
            ):
509
                return _fmt_retval(self.match_type_dict['transposition'])
510
            elif ln_equal and (
511
                levenshtein(src_fn, tar_fn, mode='osa', cost=(99, 99, 99, 1))
512
                == 1
513
            ):
514
                return _fmt_retval(self.match_type_dict['transposition'])
515
        if tests & self.test_dict['punctuation']:
516
            np_src_fn = self._synoname_strip_punct(src_fn)
517
            np_tar_fn = self._synoname_strip_punct(tar_fn)
@@ 493-503 (lines=11) @@
490
                and levenshtein(src_fn, tar_fn, cost=(1, 1, 99, 99)) == 1
491
            ):
492
                return _fmt_retval(self.match_type_dict['omission'])
493
        if tests & self.test_dict['substitution']:
494
            if (
495
                fn_equal
496
                and levenshtein(src_ln, tar_ln, cost=(99, 99, 1, 99)) == 1
497
            ):
498
                return _fmt_retval(self.match_type_dict['substitution'])
499
            elif (
500
                ln_equal
501
                and levenshtein(src_fn, tar_fn, cost=(99, 99, 1, 99)) == 1
502
            ):
503
                return _fmt_retval(self.match_type_dict['substitution'])
504
        if tests & self.test_dict['transposition']:
505
            if fn_equal and (
506
                levenshtein(src_ln, tar_ln, mode='osa', cost=(99, 99, 99, 1))
@@ 482-492 (lines=11) @@
479
        if tests & self.test_dict['exact'] and fn_equal and ln_equal:
480
            return _fmt_retval(self.match_type_dict['exact'])
481
        if tests & self.test_dict['omission']:
482
            if (
483
                fn_equal
484
                and levenshtein(src_ln, tar_ln, cost=(1, 1, 99, 99)) == 1
485
            ):
486
                if not roman_conflict:
487
                    return _fmt_retval(self.match_type_dict['omission'])
488
            elif (
489
                ln_equal
490
                and levenshtein(src_fn, tar_fn, cost=(1, 1, 99, 99)) == 1
491
            ):
492
                return _fmt_retval(self.match_type_dict['omission'])
493
        if tests & self.test_dict['substitution']:
494
            if (
495
                fn_equal