|
@@ 541-551 (lines=11) @@
|
| 538 |
|
and levenshtein(src_fn, tar_fn, cost=(99, 99, 1, 99)) == 1 |
| 539 |
|
): |
| 540 |
|
return _fmt_retval(self.match_type_dict['substitution']) |
| 541 |
|
if tests & self.test_dict['transposition']: |
| 542 |
|
if fn_equal and ( |
| 543 |
|
levenshtein(src_ln, tar_ln, mode='osa', cost=(99, 99, 99, 1)) |
| 544 |
|
== 1 |
| 545 |
|
): |
| 546 |
|
return _fmt_retval(self.match_type_dict['transposition']) |
| 547 |
|
elif ln_equal and ( |
| 548 |
|
levenshtein(src_fn, tar_fn, mode='osa', cost=(99, 99, 99, 1)) |
| 549 |
|
== 1 |
| 550 |
|
): |
| 551 |
|
return _fmt_retval(self.match_type_dict['transposition']) |
| 552 |
|
if tests & self.test_dict['punctuation']: |
| 553 |
|
np_src_fn = self._synoname_strip_punct(src_fn) |
| 554 |
|
np_tar_fn = self._synoname_strip_punct(tar_fn) |
|
@@ 530-540 (lines=11) @@
|
| 527 |
|
and levenshtein(src_fn, tar_fn, cost=(1, 1, 99, 99)) == 1 |
| 528 |
|
): |
| 529 |
|
return _fmt_retval(self.match_type_dict['omission']) |
| 530 |
|
if tests & self.test_dict['substitution']: |
| 531 |
|
if ( |
| 532 |
|
fn_equal |
| 533 |
|
and levenshtein(src_ln, tar_ln, cost=(99, 99, 1, 99)) == 1 |
| 534 |
|
): |
| 535 |
|
return _fmt_retval(self.match_type_dict['substitution']) |
| 536 |
|
elif ( |
| 537 |
|
ln_equal |
| 538 |
|
and levenshtein(src_fn, tar_fn, cost=(99, 99, 1, 99)) == 1 |
| 539 |
|
): |
| 540 |
|
return _fmt_retval(self.match_type_dict['substitution']) |
| 541 |
|
if tests & self.test_dict['transposition']: |
| 542 |
|
if fn_equal and ( |
| 543 |
|
levenshtein(src_ln, tar_ln, mode='osa', cost=(99, 99, 99, 1)) |
|
@@ 519-529 (lines=11) @@
|
| 516 |
|
if tests & self.test_dict['exact'] and fn_equal and ln_equal: |
| 517 |
|
return _fmt_retval(self.match_type_dict['exact']) |
| 518 |
|
if tests & self.test_dict['omission']: |
| 519 |
|
if ( |
| 520 |
|
fn_equal |
| 521 |
|
and levenshtein(src_ln, tar_ln, cost=(1, 1, 99, 99)) == 1 |
| 522 |
|
): |
| 523 |
|
if not roman_conflict: |
| 524 |
|
return _fmt_retval(self.match_type_dict['omission']) |
| 525 |
|
elif ( |
| 526 |
|
ln_equal |
| 527 |
|
and levenshtein(src_fn, tar_fn, cost=(1, 1, 99, 99)) == 1 |
| 528 |
|
): |
| 529 |
|
return _fmt_retval(self.match_type_dict['omission']) |
| 530 |
|
if tests & self.test_dict['substitution']: |
| 531 |
|
if ( |
| 532 |
|
fn_equal |