|
@@ 587-598 (lines=12) @@
|
| 584 |
|
|
| 585 |
|
if tests & self._test_dict['exact'] and fn_equal and ln_equal: |
| 586 |
|
return _fmt_retval(self._match_type_dict['exact']) |
| 587 |
|
if tests & self._test_dict['omission']: |
| 588 |
|
if ( |
| 589 |
|
fn_equal |
| 590 |
|
and levenshtein(src_ln, tar_ln, cost=(1, 1, 99, 99)) == 1 |
| 591 |
|
): |
| 592 |
|
if not roman_conflict: |
| 593 |
|
return _fmt_retval(self._match_type_dict['omission']) |
| 594 |
|
elif ( |
| 595 |
|
ln_equal |
| 596 |
|
and levenshtein(src_fn, tar_fn, cost=(1, 1, 99, 99)) == 1 |
| 597 |
|
): |
| 598 |
|
return _fmt_retval(self._match_type_dict['omission']) |
| 599 |
|
if tests & self._test_dict['substitution']: |
| 600 |
|
if ( |
| 601 |
|
fn_equal |
|
@@ 610-620 (lines=11) @@
|
| 607 |
|
and levenshtein(src_fn, tar_fn, cost=(99, 99, 1, 99)) == 1 |
| 608 |
|
): |
| 609 |
|
return _fmt_retval(self._match_type_dict['substitution']) |
| 610 |
|
if tests & self._test_dict['transposition']: |
| 611 |
|
if fn_equal and ( |
| 612 |
|
levenshtein(src_ln, tar_ln, mode='osa', cost=(99, 99, 99, 1)) |
| 613 |
|
== 1 |
| 614 |
|
): |
| 615 |
|
return _fmt_retval(self._match_type_dict['transposition']) |
| 616 |
|
elif ln_equal and ( |
| 617 |
|
levenshtein(src_fn, tar_fn, mode='osa', cost=(99, 99, 99, 1)) |
| 618 |
|
== 1 |
| 619 |
|
): |
| 620 |
|
return _fmt_retval(self._match_type_dict['transposition']) |
| 621 |
|
if tests & self._test_dict['punctuation']: |
| 622 |
|
np_src_fn = self._synoname_strip_punct(src_fn) |
| 623 |
|
np_tar_fn = self._synoname_strip_punct(tar_fn) |
|
@@ 599-609 (lines=11) @@
|
| 596 |
|
and levenshtein(src_fn, tar_fn, cost=(1, 1, 99, 99)) == 1 |
| 597 |
|
): |
| 598 |
|
return _fmt_retval(self._match_type_dict['omission']) |
| 599 |
|
if tests & self._test_dict['substitution']: |
| 600 |
|
if ( |
| 601 |
|
fn_equal |
| 602 |
|
and levenshtein(src_ln, tar_ln, cost=(99, 99, 1, 99)) == 1 |
| 603 |
|
): |
| 604 |
|
return _fmt_retval(self._match_type_dict['substitution']) |
| 605 |
|
elif ( |
| 606 |
|
ln_equal |
| 607 |
|
and levenshtein(src_fn, tar_fn, cost=(99, 99, 1, 99)) == 1 |
| 608 |
|
): |
| 609 |
|
return _fmt_retval(self._match_type_dict['substitution']) |
| 610 |
|
if tests & self._test_dict['transposition']: |
| 611 |
|
if fn_equal and ( |
| 612 |
|
levenshtein(src_ln, tar_ln, mode='osa', cost=(99, 99, 99, 1)) |