@@ 515-525 (lines=11) @@ | ||
512 | and levenshtein(src_fn, tar_fn, cost=(99, 99, 1, 99)) == 1 |
|
513 | ): |
|
514 | return _fmt_retval(self.match_type_dict['substitution']) |
|
515 | if tests & self.test_dict['transposition']: |
|
516 | if fn_equal and ( |
|
517 | levenshtein(src_ln, tar_ln, mode='osa', cost=(99, 99, 99, 1)) |
|
518 | == 1 |
|
519 | ): |
|
520 | return _fmt_retval(self.match_type_dict['transposition']) |
|
521 | elif ln_equal and ( |
|
522 | levenshtein(src_fn, tar_fn, mode='osa', cost=(99, 99, 99, 1)) |
|
523 | == 1 |
|
524 | ): |
|
525 | return _fmt_retval(self.match_type_dict['transposition']) |
|
526 | if tests & self.test_dict['punctuation']: |
|
527 | np_src_fn = self._synoname_strip_punct(src_fn) |
|
528 | np_tar_fn = self._synoname_strip_punct(tar_fn) |
|
@@ 504-514 (lines=11) @@ | ||
501 | and levenshtein(src_fn, tar_fn, cost=(1, 1, 99, 99)) == 1 |
|
502 | ): |
|
503 | return _fmt_retval(self.match_type_dict['omission']) |
|
504 | if tests & self.test_dict['substitution']: |
|
505 | if ( |
|
506 | fn_equal |
|
507 | and levenshtein(src_ln, tar_ln, cost=(99, 99, 1, 99)) == 1 |
|
508 | ): |
|
509 | return _fmt_retval(self.match_type_dict['substitution']) |
|
510 | elif ( |
|
511 | ln_equal |
|
512 | and levenshtein(src_fn, tar_fn, cost=(99, 99, 1, 99)) == 1 |
|
513 | ): |
|
514 | return _fmt_retval(self.match_type_dict['substitution']) |
|
515 | if tests & self.test_dict['transposition']: |
|
516 | if fn_equal and ( |
|
517 | levenshtein(src_ln, tar_ln, mode='osa', cost=(99, 99, 99, 1)) |
|
@@ 493-503 (lines=11) @@ | ||
490 | if tests & self.test_dict['exact'] and fn_equal and ln_equal: |
|
491 | return _fmt_retval(self.match_type_dict['exact']) |
|
492 | if tests & self.test_dict['omission']: |
|
493 | if ( |
|
494 | fn_equal |
|
495 | and levenshtein(src_ln, tar_ln, cost=(1, 1, 99, 99)) == 1 |
|
496 | ): |
|
497 | if not roman_conflict: |
|
498 | return _fmt_retval(self.match_type_dict['omission']) |
|
499 | elif ( |
|
500 | ln_equal |
|
501 | and levenshtein(src_fn, tar_fn, cost=(1, 1, 99, 99)) == 1 |
|
502 | ): |
|
503 | return _fmt_retval(self.match_type_dict['omission']) |
|
504 | if tests & self.test_dict['substitution']: |
|
505 | if ( |
|
506 | fn_equal |